2020-04-27 18:38:39 +00:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
parser: "babel-eslint",
|
|
|
|
parserOptions: {
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"jsx": true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
"browser": true,
|
|
|
|
"commonjs": true,
|
|
|
|
"es6": true,
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
"process": false
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
"react",
|
2020-10-27 16:28:23 +00:00
|
|
|
"react-hooks",
|
|
|
|
"mocha"
|
2020-04-27 18:38:39 +00:00
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
"quotes": [
|
|
|
|
1,
|
|
|
|
"single",
|
|
|
|
{
|
|
|
|
"avoidEscape": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"no-console": 1,
|
|
|
|
"no-restricted-globals": [
|
|
|
|
2,
|
|
|
|
"length"
|
|
|
|
],
|
|
|
|
"no-global-assign": 0,
|
|
|
|
"no-unsafe-negation": 0,
|
|
|
|
"react/prop-types": 0,
|
|
|
|
"react/jsx-no-target-blank": 0,
|
|
|
|
"react/no-unescaped-entities": 0,
|
|
|
|
"react/display-name": 1,
|
|
|
|
"react-hooks/rules-of-hooks": "error",
|
2020-10-27 16:28:23 +00:00
|
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
|
|
"react/jsx-uses-react": "off",
|
|
|
|
"react/react-in-jsx-scope": "off",
|
|
|
|
"mocha/no-skipped-tests": "warn",
|
2021-09-15 15:34:49 +00:00
|
|
|
"mocha/no-exclusive-tests": "error",
|
|
|
|
'no-restricted-syntax': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
message: "Utilisez le composant <Emoji /> plutôt que la function emoji directement importée de react-easy-emoji",
|
|
|
|
selector:
|
|
|
|
"CallExpression[callee.name='emoji']"
|
|
|
|
}
|
|
|
|
]
|
2020-04-27 18:38:39 +00:00
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
"react": {
|
|
|
|
"version": "detect"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: [ "**/*.{ts,tsx}" ],
|
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
parserOptions: {
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"jsx": true
|
|
|
|
},
|
|
|
|
"tsconfigRootDir": __dirname,
|
2021-11-30 16:47:28 +00:00
|
|
|
"project": [ "./mon-entreprise/tsconfig.json" ]
|
2020-04-27 18:38:39 +00:00
|
|
|
},
|
|
|
|
plugins: [ "@typescript-eslint" ],
|
|
|
|
rules: {
|
2021-11-30 15:09:05 +00:00
|
|
|
"@typescript-eslint/no-empty-interface": 0,
|
2020-04-27 18:38:39 +00:00
|
|
|
"@typescript-eslint/no-empty-function": 0,
|
|
|
|
"@typescript-eslint/no-use-before-define": 0,
|
|
|
|
"@typescript-eslint/member-delimiter-style": [2, {
|
|
|
|
multiline: {
|
|
|
|
delimiter: "none"
|
|
|
|
}
|
|
|
|
}],
|
2020-04-30 15:13:45 +00:00
|
|
|
"@typescript-eslint/explicit-function-return-type": 0,
|
|
|
|
'@typescript-eslint/prefer-string-starts-ends-with': 1,
|
|
|
|
'@typescript-eslint/no-unnecessary-type-assertion': 1, // has false positives (Object.values result) v 2.29.0
|
2020-10-27 16:28:23 +00:00
|
|
|
'@typescript-eslint/no-inferrable-types': 1, // causes problems with unknown values v 2.29.0 typescript v 3.8.3
|
|
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
|
|
// TODO - enable these new recommended rules, a first step would be to switch from "off" to "warn"
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
'@typescript-eslint/no-floating-promises': 'off',
|
|
|
|
'@typescript-eslint/no-extra-semi': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
|
|
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
|
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
|
|
'@typescript-eslint/naming-convention': 'off',
|
|
|
|
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
2020-04-27 18:38:39 +00:00
|
|
|
},
|
|
|
|
extends: [
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2020-10-27 16:28:23 +00:00
|
|
|
files: ["**/*.test.js"],
|
2020-04-27 18:38:39 +00:00
|
|
|
env: {
|
|
|
|
mocha: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
extends: [
|
|
|
|
"eslint:recommended",
|
|
|
|
"plugin:react/recommended",
|
|
|
|
"prettier",
|
|
|
|
"prettier/react",
|
|
|
|
"prettier/@typescript-eslint"
|
|
|
|
]
|
|
|
|
}
|