|
1 | | -/** |
2 | | - * Debugging: |
3 | | - * https://eslint.org/docs/latest/use/configure/debug |
4 | | - * ---------------------------------------------------- |
5 | | - * |
6 | | - * Print a file's calculated configuration |
7 | | - * |
8 | | - * npx eslint --print-config path/to/file.js |
9 | | - * |
10 | | - * Inspecting the config |
11 | | - * |
12 | | - * npx eslint --inspect-config |
13 | | - * |
14 | | - */ |
15 | | -import babelParser from '@babel/eslint-parser'; |
16 | | -import js from '@eslint/js'; |
17 | | -import prettier from 'eslint-config-prettier'; |
18 | | -import ember from 'eslint-plugin-ember/recommended'; |
19 | | -import importPlugin from 'eslint-plugin-import'; |
20 | | -import n from 'eslint-plugin-n'; |
21 | | -import globals from 'globals'; |
22 | | -import ts from 'typescript-eslint'; |
| 1 | +import { configs } from '@nullvoxpopuli/eslint-configs'; |
23 | 2 |
|
24 | | -const esmParserOptions = { |
25 | | - ecmaFeatures: { modules: true }, |
26 | | - ecmaVersion: 'latest', |
27 | | -}; |
28 | | - |
29 | | -const tsParserOptions = { |
30 | | - projectService: true, |
31 | | - project: true, |
32 | | - tsconfigRootDir: import.meta.dirname, |
33 | | -}; |
34 | | - |
35 | | -const config = [ |
36 | | - js.configs.recommended, |
37 | | - prettier, |
38 | | - ember.configs.base, |
39 | | - ember.configs.gjs, |
40 | | - ember.configs.gts, |
41 | | - /** |
42 | | - * Ignores must be in their own object |
43 | | - * https://eslint.org/docs/latest/use/configure/ignore |
44 | | - */ |
45 | | - { |
46 | | - ignores: [ |
47 | | - 'dist/', |
48 | | - 'dist-*/', |
49 | | - 'declarations/', |
50 | | - 'node_modules/', |
51 | | - 'coverage/', |
52 | | - '!**/.*', |
53 | | - ], |
54 | | - }, |
55 | | - /** |
56 | | - * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options |
57 | | - */ |
58 | | - { |
59 | | - linterOptions: { |
60 | | - reportUnusedDisableDirectives: 'error', |
61 | | - }, |
62 | | - }, |
63 | | - { |
64 | | - files: ['**/*.js'], |
65 | | - languageOptions: { |
66 | | - parser: babelParser, |
67 | | - }, |
68 | | - }, |
69 | | - { |
70 | | - files: ['**/*.{js,gjs}'], |
71 | | - languageOptions: { |
72 | | - parserOptions: esmParserOptions, |
73 | | - globals: { |
74 | | - ...globals.browser, |
75 | | - }, |
76 | | - }, |
77 | | - }, |
78 | | - { |
79 | | - files: ['**/*.{ts,gts}'], |
80 | | - languageOptions: { |
81 | | - parser: ember.parser, |
82 | | - parserOptions: tsParserOptions, |
83 | | - }, |
84 | | - extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts], |
85 | | - }, |
| 3 | +// accommodates: JS, TS, App, Addon, and V2 Addon |
| 4 | +export default [ |
| 5 | + ...configs.ember(import.meta.dirname), |
86 | 6 | { |
87 | | - files: ['src/**/*'], |
88 | | - plugins: { |
89 | | - import: importPlugin, |
90 | | - }, |
| 7 | + files: ['**/*.ts'], |
91 | 8 | rules: { |
92 | | - // require relative imports use full extensions |
93 | | - 'import/extensions': ['error', 'always', { ignorePackages: true }], |
94 | | - }, |
95 | | - }, |
96 | | - /** |
97 | | - * CJS node files |
98 | | - */ |
99 | | - { |
100 | | - files: [ |
101 | | - '**/*.cjs', |
102 | | - '.prettierrc.cjs', |
103 | | - '.template-lintrc.cjs', |
104 | | - 'addon-main.cjs', |
105 | | - ], |
106 | | - plugins: { |
107 | | - n, |
108 | | - }, |
109 | | - |
110 | | - languageOptions: { |
111 | | - sourceType: 'script', |
112 | | - ecmaVersion: 'latest', |
113 | | - globals: { |
114 | | - ...globals.node, |
115 | | - }, |
116 | | - }, |
117 | | - }, |
118 | | - /** |
119 | | - * ESM node files |
120 | | - */ |
121 | | - { |
122 | | - files: ['**/*.mjs'], |
123 | | - plugins: { |
124 | | - n, |
125 | | - }, |
126 | | - |
127 | | - languageOptions: { |
128 | | - sourceType: 'module', |
129 | | - ecmaVersion: 'latest', |
130 | | - parserOptions: esmParserOptions, |
131 | | - globals: { |
132 | | - ...globals.node, |
133 | | - }, |
| 9 | + '@typescript-eslint/no-explicit-any': 'off', |
| 10 | + '@typescript-eslint/unbound-method': 'off', |
| 11 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 12 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 13 | + '@typescript-eslint/no-unsafe-argument': 'off', |
134 | 14 | }, |
135 | 15 | }, |
136 | 16 | ]; |
137 | | - |
138 | | -export default ts.config(...config); |
0 commit comments