Eslint extension highlighted some issues with the way we were importing the tsconfig.json file in the .eslintrc.json file. By changing the extension to .cjs, we are now able to set tsconfigRootDir to the root of the package thanks to `dirname`. It helps eslint to find the correct tsconfig.json file.
93 lines
3.0 KiB
JSON
93 lines
3.0 KiB
JSON
{
|
|
"env": {
|
|
"browser": true,
|
|
"jest": true,
|
|
"es6": true
|
|
},
|
|
"extends": [
|
|
"airbnb",
|
|
"airbnb-typescript",
|
|
"plugin:compat/recommended",
|
|
"plugin:prettier/recommended"
|
|
],
|
|
"parser": "@typescript-eslint/parser",
|
|
"parserOptions": {
|
|
/*
|
|
To use eslint with VSCode and see lint error directly in file,
|
|
you have to install dbaeumer.vscode-eslint extension
|
|
and you may have to tweak your workspace settings with:
|
|
"eslint.workingDirectories": ["src/frontend"]
|
|
|
|
As frontend is not at the root of the repository,
|
|
this setting allows ESLint extension to find the ./tsconfig.json file
|
|
*/
|
|
"project": "./tsconfig.json",
|
|
"ecmaFeatures": {
|
|
"jsx": true
|
|
}
|
|
},
|
|
"plugins": ["formatjs", "@typescript-eslint", "import"],
|
|
/* Disable some rules to be iso with tslint which was previously used */
|
|
"rules": {
|
|
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
|
|
"@typescript-eslint/lines-between-class-members": "off",
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
"arrow-parens": "error",
|
|
"consistent-return": "off",
|
|
"default-case": "off",
|
|
"formatjs/no-multiple-whitespaces": "error",
|
|
"formatjs/enforce-description": "error",
|
|
"formatjs/enforce-default-message": "error",
|
|
"global-require": "off",
|
|
"import/extensions": "off",
|
|
"import/no-cycle": ["off"],
|
|
"import/no-dynamic-require": "off",
|
|
"import/order": [
|
|
"error",
|
|
{
|
|
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
|
|
"alphabetize": { "order": "ignore" }
|
|
}
|
|
],
|
|
"import/prefer-default-export": "off",
|
|
"jsx-a11y/click-events-have-key-events": "off",
|
|
"jsx-a11y/label-has-associated-control": "warn",
|
|
"no-console": ["error", { "allow": ["warn"] }],
|
|
"no-else-return": "off",
|
|
"no-empty-function": "off",
|
|
"no-nested-ternary": "warn",
|
|
"no-param-reassign": "off",
|
|
"no-plusplus": "off",
|
|
"no-promise-executor-return": "off",
|
|
"no-prototype-builtins": "off",
|
|
"no-return-assign": "off",
|
|
"no-return-await": "off",
|
|
"no-undef": "off",
|
|
"no-underscore-dangle": "off",
|
|
"no-useless-escape": "off",
|
|
"prefer-template": "off",
|
|
"react/button-has-type": "off",
|
|
"react/destructuring-assignment": "off",
|
|
"react/function-component-definition": [
|
|
"error",
|
|
{ "namedComponents": "arrow-function", "unnamedComponents": "arrow-function" }
|
|
],
|
|
"react/jsx-boolean-value": "off",
|
|
"react/jsx-fragments": "off",
|
|
"react/jsx-props-no-spreading": "off",
|
|
"react/jsx-uses-react": "off",
|
|
"react/no-array-index-key": "warn",
|
|
"react/prop-types": "off",
|
|
"react/react-in-jsx-scope": "off",
|
|
"react/require-default-props": "off",
|
|
"react/style-prop-object": ["error", { "allow": ["FormattedNumber"] }]
|
|
},
|
|
"settings": {
|
|
"polyfills": ["fetch", "Promise"],
|
|
"import/resolver": {
|
|
"typescript": true
|
|
}
|
|
},
|
|
"ignorePatterns": ["node_modules/", "dist/"]
|
|
}
|