Update ESLint's config with better rules
antoine-cottineau opened this issue · comments
Antoine Cottineau commented
We should have rules that are commonly used by many projects at BAM.
See this page for an inventory of the ESLint configs used in the projects.
Here are some notes taken by BaptisteM to begin creating a shared config:
Extends :[
plugin:react/recommended,
plugin:@typescript-eslint/recommended,
'plugin:jest/recommended',
'plugin:prettier/recommended',
]
Plugin :
@typescript-eslint
Import
Import
"import/prefer-default-export": "off",
"import/no-named-as-default": "off", => « error »
"import/newline-after-import": ["error", { "count": 1 }],
"import/no-extraneous-dependencies": "off",
TS
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
"@typescript-eslint/ban-types": "warn",
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': [ 'error', { allow: ['private-
constructors'], }, ],
'@typescript-eslint/strict-boolean-expressions': ['error',
{ allowNullableBoolean: true }],
"@typescript-eslint/array-type": [1, { "default": "array" }],