diff options
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 97 |
1 files changed, 75 insertions, 22 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index d3bc05b..2660c04 100644 --- a/.eslintrc.js +++ b/.eslintrc.js | |||
@@ -1,33 +1,86 @@ | |||
1 | /** @type {import('eslint').Linter.Config} */ | ||
1 | module.exports = { | 2 | module.exports = { |
2 | root: true, | 3 | root: true, |
3 | env: { | 4 | parserOptions: { |
4 | commonjs: true, | 5 | ecmaVersion: 2018, |
5 | es6: true, | 6 | sourceType: 'module', |
6 | node: true, | 7 | project: './tsconfig.json', |
7 | }, | 8 | }, |
8 | extends: ['airbnb-base'], | 9 | ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'], |
10 | extends: [ | ||
11 | 'plugin:adonis/typescriptApp', | ||
12 | 'plugin:unicorn/recommended', | ||
13 | 'prettier', | ||
14 | ], | ||
15 | plugins: [], | ||
9 | globals: { | 16 | globals: { |
10 | Atomics: 'readonly', | 17 | use: true, |
11 | SharedArrayBuffer: 'readonly', | ||
12 | use: 'readonly', | ||
13 | window: 'readonly', | ||
14 | document: 'readonly', | ||
15 | ENV: 'readonly', | ||
16 | session: 'readonly', | ||
17 | response: 'readonly', | ||
18 | }, | 18 | }, |
19 | parserOptions: { | 19 | env: { |
20 | ecmaVersion: 2018, | 20 | es6: true, |
21 | node: true, | ||
21 | }, | 22 | }, |
23 | reportUnusedDisableDirectives: true, | ||
24 | overrides: [ | ||
25 | { | ||
26 | files: ['**/*.ts'], | ||
27 | extends: [ | ||
28 | 'plugin:adonis/typescriptApp', | ||
29 | 'plugin:@typescript-eslint/eslint-recommended', | ||
30 | 'plugin:@typescript-eslint/strict', | ||
31 | // TODO: Opt-in to a stricter ruleset in the future | ||
32 | // 'plugin:@typescript-eslint/strict-type-checked', | ||
33 | 'plugin:@typescript-eslint/stylistic-type-checked', | ||
34 | 'plugin:import/typescript', | ||
35 | ], | ||
36 | parser: '@typescript-eslint/parser', | ||
37 | plugins: [], | ||
38 | rules: { | ||
39 | // eslint | ||
40 | 'max-len': 0, | ||
41 | |||
42 | // @typescript-eslint | ||
43 | '@typescript-eslint/no-non-null-assertion': 0, | ||
44 | '@typescript-eslint/no-empty-interface': 0, | ||
45 | '@typescript-eslint/semi': 0, | ||
46 | '@typescript-eslint/space-before-function-paren': 0, | ||
47 | '@typescript-eslint/no-extraneous-class': 0, | ||
48 | '@typescript-eslint/ban-ts-comment': 0, | ||
49 | '@typescript-eslint/prefer-ts-expect-error': 0, | ||
50 | }, | ||
51 | }, | ||
52 | ], | ||
22 | rules: { | 53 | rules: { |
23 | 'arrow-parens': 0, | 54 | // eslint |
24 | 'class-methods-use-this': 0, | 55 | 'array-callback-return': 1, |
25 | eqeqeq: 1, | 56 | 'consistent-return': 1, |
26 | 'implicit-arrow-linebreak': 0, | ||
27 | 'max-len': 0, | 57 | 'max-len': 0, |
28 | 'no-await-in-loop': 1, | 58 | 'no-await-in-loop': 1, |
29 | 'no-restricted-syntax': 0, | 59 | 'no-return-assign': 1, |
30 | 'operator-linebreak': 0, | 60 | 'no-console': [ |
31 | 'object-curly-newline': 0, | 61 | 1, |
62 | { | ||
63 | allow: ['warn', 'error'], | ||
64 | }, | ||
65 | ], | ||
66 | 'no-param-reassign': 1, | ||
67 | 'prefer-destructuring': 1, | ||
68 | // eslint-plugin-unicorn | ||
69 | 'unicorn/filename-case': 0, | ||
70 | 'unicorn/prefer-module': 0, | ||
71 | 'unicorn/prevent-abbreviations': 0, | ||
72 | |||
73 | 'unicorn/import-style': [ | ||
74 | 2, | ||
75 | { | ||
76 | styles: { | ||
77 | path: { | ||
78 | named: true, | ||
79 | }, | ||
80 | }, | ||
81 | }, | ||
82 | ], | ||
83 | 'unicorn/no-empty-file': 0, | ||
84 | 'unicorn/prefer-top-level-await': 0, | ||
32 | }, | 85 | }, |
33 | }; | 86 | }; |