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

同一文件夹内不同语法规则如何配置 ESLint? #111

Open
iugo opened this issue Oct 14, 2019 · 0 comments
Open

同一文件夹内不同语法规则如何配置 ESLint? #111

iugo opened this issue Oct 14, 2019 · 0 comments

Comments

@iugo
Copy link
Member

iugo commented Oct 14, 2019

问题:

比如 js, ts, jest 文件同时存在.

需要使用 overrides 配置项. 比如:

"overrides": [
  {
    "files": ["*.spec.ts"],
    "extends": ["plugin:jest/recommended"],
    "env": {
      "jest/globals": true
    }
  }
]

在 ESLint 6 中, 已经解决了一些适配问题, 让更多的全局属性可以被 override, 比如 eslint/eslint#8813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant