2021-12-07 12:46:03 +00:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
2022-02-07 08:34:32 +00:00
|
|
|
parser: '@typescript-eslint/parser',
|
2021-12-07 12:46:03 +00:00
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
ecmaVersion: 'latest',
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
commonjs: true,
|
|
|
|
es6: true,
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
process: false,
|
|
|
|
},
|
2022-02-07 08:34:32 +00:00
|
|
|
extends: ['eslint:recommended', 'prettier'],
|
2021-12-07 12:46:03 +00:00
|
|
|
rules: {
|
2022-02-07 08:34:32 +00:00
|
|
|
'no-console': 'warn',
|
|
|
|
'no-restricted-globals': ['error', 'length'],
|
2021-12-07 12:46:03 +00:00
|
|
|
'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']",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
overrides: [
|
2022-02-07 08:34:32 +00:00
|
|
|
{
|
|
|
|
files: ['**/*.{js,jsx}'],
|
|
|
|
env: { node: true },
|
|
|
|
},
|
2021-12-07 12:46:03 +00:00
|
|
|
{
|
|
|
|
files: ['**/*.{ts,tsx}'],
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
2022-02-07 08:34:32 +00:00
|
|
|
ecmaFeatures: { jsx: true },
|
2021-12-07 12:46:03 +00:00
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
tsconfigRootDir: __dirname,
|
2022-03-03 13:37:53 +00:00
|
|
|
project: [
|
|
|
|
'./site/tsconfig.json',
|
|
|
|
'./modele-social/tsconfig.json',
|
|
|
|
'./exoneration-covid/tsconfig.json',
|
|
|
|
],
|
2021-12-07 12:46:03 +00:00
|
|
|
},
|
|
|
|
extends: [
|
2022-02-07 08:34:32 +00:00
|
|
|
'eslint:recommended',
|
2022-04-04 13:47:07 +00:00
|
|
|
'standard',
|
2021-12-07 12:46:03 +00:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
2022-02-07 08:34:32 +00:00
|
|
|
'plugin:react/recommended',
|
|
|
|
'plugin:react/jsx-runtime',
|
|
|
|
'plugin:react-hooks/recommended',
|
|
|
|
'prettier',
|
2021-12-07 12:46:03 +00:00
|
|
|
],
|
2022-02-07 08:34:32 +00:00
|
|
|
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
|
|
|
|
rules: {
|
2022-04-04 15:06:21 +00:00
|
|
|
'no-void': 'off',
|
2022-02-07 08:34:32 +00:00
|
|
|
'ban-ts-comment': 'off',
|
2022-04-04 15:06:21 +00:00
|
|
|
'no-use-before-define': 'off',
|
2022-02-07 08:34:32 +00:00
|
|
|
'react/no-unescaped-entities': 'off',
|
|
|
|
'react/jsx-no-target-blank': 'off',
|
|
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
|
|
|
|
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
|
|
|
|
|
|
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
|
|
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
2022-03-28 10:08:02 +00:00
|
|
|
|
2022-02-07 08:34:32 +00:00
|
|
|
'@typescript-eslint/member-delimiter-style': [
|
|
|
|
'error',
|
|
|
|
{ multiline: { delimiter: 'none' } },
|
|
|
|
],
|
2022-03-28 10:08:02 +00:00
|
|
|
|
2022-04-04 13:47:07 +00:00
|
|
|
// Auto fixable lint error
|
2022-03-28 10:08:02 +00:00
|
|
|
'prefer-const': 'error',
|
|
|
|
'padding-line-between-statements': [
|
|
|
|
'error',
|
|
|
|
// Require padding line before return statement
|
|
|
|
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
|
|
//Require padding line after import
|
|
|
|
{ blankLine: 'always', prev: ['import', 'cjs-import'], next: '*' },
|
|
|
|
{
|
|
|
|
blankLine: 'any',
|
|
|
|
prev: ['import', 'cjs-import'],
|
|
|
|
next: ['import', 'cjs-import'],
|
|
|
|
},
|
|
|
|
//Require padding line before export
|
|
|
|
{ blankLine: 'always', prev: '*', next: ['export', 'cjs-export'] },
|
|
|
|
{
|
|
|
|
blankLine: 'any',
|
|
|
|
prev: ['export', 'cjs-export'],
|
|
|
|
next: ['export', 'cjs-export'],
|
|
|
|
},
|
|
|
|
],
|
2022-02-07 08:34:32 +00:00
|
|
|
},
|
2021-12-07 12:46:03 +00:00
|
|
|
},
|
|
|
|
{
|
2022-02-07 08:34:32 +00:00
|
|
|
files: ['**/*.test.{js,ts}', 'site/cypress/**/*.js'],
|
2021-12-07 12:46:03 +00:00
|
|
|
env: {
|
|
|
|
mocha: true,
|
|
|
|
},
|
2022-02-07 08:34:32 +00:00
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:cypress/recommended',
|
|
|
|
'plugin:mocha/recommended',
|
|
|
|
'prettier',
|
|
|
|
],
|
|
|
|
plugins: ['cypress', 'mocha'],
|
|
|
|
rules: {
|
|
|
|
'cypress/no-unnecessary-waiting': 'warn',
|
|
|
|
|
|
|
|
'mocha/no-exclusive-tests': 'error',
|
|
|
|
'mocha/no-skipped-tests': 'warn',
|
|
|
|
'mocha/no-mocha-arrows': 'warn',
|
|
|
|
'mocha/no-setup-in-describe': 'warn',
|
|
|
|
'mocha/max-top-level-suites': 'warn',
|
|
|
|
'mocha/no-global-tests': 'warn',
|
|
|
|
'mocha/no-exports': 'warn',
|
|
|
|
},
|
2021-12-07 12:46:03 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|