Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimentalECMAScriptMoudlesExtension: boolean #10451

Closed
achun opened this issue Jun 7, 2018 · 8 comments
Closed

Add experimentalECMAScriptMoudlesExtension: boolean #10451

achun opened this issue Jun 7, 2018 · 8 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion needs info Not enough information has been provided to triage this issue triage An ESLint team member will look at this issue soon

Comments

@achun
Copy link

achun commented Jun 7, 2018

The developer chose to use ".mjs" as the extension, indicating that he is very clear that this is experimental and that he is using experimental features.

We know that ecmaFeatures has the experimentalObjectRestSpread option, to follow...

Proposal: add an option in env

{
  "env": {
      "experimentalECMAScriptMoudlesExtension": true
  }
}
@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jun 7, 2018
@not-an-aardvark not-an-aardvark added the needs info Not enough information has been provided to triage this issue label Jun 7, 2018
@eslint-deprecated
Copy link

Hi @achun, thanks for the issue. It looks like there's not enough information for us to know how to help you.

If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

Requesting a rule change? Please see Proposing a Rule Change for instructions.

If it's something else, please just provide as much additional information as possible. Thanks!

@achun
Copy link
Author

achun commented Jun 7, 2018

needs info???????

Well, I give up this proposal.

@achun achun closed this as completed Jun 7, 2018
@aladdin-add
Copy link
Member

not very sure what you were proposing here, just want to point out experimentalObjectRestSpread has been deprecated in #10230.

@achun
Copy link
Author

achun commented Jun 7, 2018

@aladdin-add 谢谢,

早知道我直接用中文写了, 我英文太差, 长篇的写肯定写崩了.
的确没看到 #10230 已经把 experimentalObjectRestSpread 废弃.
我说呢, 既然允许 experimental 这种选项存在, 那么要求周知的实验性选项被加入就合理了.
现在不同了, 既然 estree 坚守标准, 那我这个提案应该被拒绝.

另外, ECMAScript Modules 这个 .mjs 扩展名(也就是不使用 require, 只使用 import,export) 竟然是实验性的.
真是讽刺啊, ECMAScript Modules 明明是标准的, 而且现在已经被大厂支持了, require 只是社区建立的标准, 这两个完全不是一个级别的. 这是历史留下的 BUG 啊,,,,

eslint 的选择,,, 我也是没法儿评论对错了

@platinumazure
Copy link
Member

You can run ESLint to search for mjs files:

eslint . --ext mjs

Or:

eslint "**/*.mjs"

And you can also run on both extensions if needed:

eslint . --ext mjs,js
eslint "**/*.{js,mjs}"

Hope this helps!

@achun
Copy link
Author

achun commented Jun 7, 2018

@platinumazure Thanks first.

I know that way. I need to get support in the configuration. In some environments, using the command line is an obstacle. Such as VS code.

先感谢你, 命令行的方法我是知道的, 我的需求是在配置中得到支持, 有些时候无法方便的使用命令行, 比如在 vs code 中只能通过配置文件来让 eslint 工作.

另外, 还是那个,,,,, 这本应该是标准啊, 现在却难堪的变成了实验性的,,,,,

@platinumazure
Copy link
Member

@achun You could use glob-based configuration to add specific configuration for .mjs files.

@achun
Copy link
Author

achun commented Jun 7, 2018

@platinumazure Thanks.

eslint is work for '*.mjs'

The configuration .eslintrc.js

module.exports = {
    "env": {
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "sourceType": "module"
    },
    "rules": {
        "indent": [
            "error",
            2
        ],
        "linebreak-style": [
            "error",
            "unix"
        ],
        "quotes": [
            "error",
            "single"
        ],
        "semi": [
            "error",
            "never"
        ]
    }
};

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion needs info Not enough information has been provided to triage this issue triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

4 participants