diff options
Diffstat (limited to '.eslintrc.cjs')
-rw-r--r-- | .eslintrc.cjs | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..2be48ef --- /dev/null +++ b/.eslintrc.cjs | |||
@@ -0,0 +1,89 @@ | |||
1 | /** @type {import('eslint').Linter.Config} */ | ||
2 | module.exports = { | ||
3 | root: true, | ||
4 | parserOptions: { | ||
5 | ecmaVersion: 'latest', | ||
6 | sourceType: 'module', | ||
7 | project: './tsconfig.json', | ||
8 | }, | ||
9 | ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'], | ||
10 | extends: ['@adonisjs/eslint-config/app', 'plugin:unicorn/recommended', 'prettier'], | ||
11 | plugins: ['@adonisjs/eslint-plugin'], | ||
12 | env: { | ||
13 | es6: true, | ||
14 | node: true, | ||
15 | }, | ||
16 | reportUnusedDisableDirectives: true, | ||
17 | overrides: [ | ||
18 | { | ||
19 | files: ['**/*.ts'], | ||
20 | extends: [ | ||
21 | '@adonisjs/eslint-config/app', | ||
22 | 'plugin:@typescript-eslint/eslint-recommended', | ||
23 | 'plugin:@typescript-eslint/strict', | ||
24 | // TODO: Opt-in to a stricter ruleset in the future | ||
25 | // 'plugin:@typescript-eslint/strict-type-checked', | ||
26 | 'plugin:@typescript-eslint/stylistic-type-checked', | ||
27 | 'plugin:import/typescript', | ||
28 | ], | ||
29 | parser: '@typescript-eslint/parser', | ||
30 | plugins: [], | ||
31 | rules: { | ||
32 | // eslint | ||
33 | 'max-len': 0, | ||
34 | |||
35 | // @typescript-eslint | ||
36 | '@typescript-eslint/no-non-null-assertion': 0, | ||
37 | '@typescript-eslint/no-empty-interface': 0, | ||
38 | '@typescript-eslint/semi': 0, | ||
39 | '@typescript-eslint/space-before-function-paren': 0, | ||
40 | '@typescript-eslint/no-extraneous-class': 0, | ||
41 | '@typescript-eslint/ban-ts-comment': 0, | ||
42 | '@typescript-eslint/prefer-ts-expect-error': 0, | ||
43 | '@typescript-eslint/explicit-member-accessibility': 0, | ||
44 | '@typescript-eslint/no-shadow': 0, | ||
45 | '@typescript-eslint/prefer-nullish-coalescing': 0, | ||
46 | |||
47 | // @adonisjs/eslint-plugin | ||
48 | '@adonisjs/prefer-lazy-controller-import': 2, | ||
49 | '@adonisjs/prefer-lazy-listener-import': 2, | ||
50 | |||
51 | // eslint-plugin-unicorn | ||
52 | 'unicorn/filename-case': 0, | ||
53 | }, | ||
54 | }, | ||
55 | ], | ||
56 | rules: { | ||
57 | // eslint | ||
58 | 'array-callback-return': 1, | ||
59 | 'consistent-return': 1, | ||
60 | 'max-len': 0, | ||
61 | 'no-await-in-loop': 1, | ||
62 | 'no-return-assign': 1, | ||
63 | 'no-console': [ | ||
64 | 1, | ||
65 | { | ||
66 | allow: ['warn', 'error'], | ||
67 | }, | ||
68 | ], | ||
69 | 'no-param-reassign': 1, | ||
70 | 'prefer-destructuring': 1, | ||
71 | // eslint-plugin-unicorn | ||
72 | 'unicorn/filename-case': 0, | ||
73 | 'unicorn/prefer-module': 0, | ||
74 | 'unicorn/prevent-abbreviations': 0, | ||
75 | |||
76 | 'unicorn/import-style': [ | ||
77 | 2, | ||
78 | { | ||
79 | styles: { | ||
80 | path: { | ||
81 | named: true, | ||
82 | }, | ||
83 | }, | ||
84 | }, | ||
85 | ], | ||
86 | 'unicorn/no-empty-file': 0, | ||
87 | 'unicorn/prefer-top-level-await': 0, | ||
88 | }, | ||
89 | } | ||