0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
wagtail/.eslintrc
Thibaud Colas fd563b6adf
Use TypeScript configuration for all JS linting (#6862)
- Switches our JS linting to be done with the TypeScript parser, and TypeScript rules. They handle JavaScript as well, and using the same parser everywhere matches how our build tools work. Additionally I had to disable a few rules for test files and webpack.config.js.
- Adds --report-unused-disable-directives to our linting script, and removes the unused directives.
2021-03-05 16:54:11 +00:00

45 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"wagtail",
"plugin:@typescript-eslint/recommended"
],
"env": {
"jest": true
},
"settings": {
"import/resolver": {
"webpack": {
"config": "client/webpack.config.js"
}
}
},
"rules": {
"no-underscore-dangle": ["error", { "allow": ["__REDUX_DEVTOOLS_EXTENSION__"] }],
// note you must disable the base rule as it can report incorrect errors
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off"
},
"overrides": [
{
// Rules we dont want to enforce for test and tooling code.
"files": ["*.test.ts", "*.test.tsx", "*.test.js", "webpack.config.js"],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
]
}