@egy186/eslint-config 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ TypeScript, tsconfig:
46
46
  import { base } from '@egy186/eslint-config';
47
47
  import { typescriptConfig } from '@egy186/eslint-config/typescript';
48
48
 
49
- export default [base, typescriptConfig({ project: 'path/to/tsconfig.eslint.json' })];
49
+ export default [base, typescriptConfig({ projectService: { allowDefaultProject: ['*.ts'] } })];
50
50
  ```
51
51
 
52
52
  Jest:
package/dist/base.d.ts CHANGED
@@ -187,6 +187,7 @@ declare const config: {
187
187
  }];
188
188
  readonly '@stylistic/comma-style': ["error", "last"];
189
189
  readonly '@stylistic/computed-property-spacing': ["error", "never"];
190
+ readonly '@stylistic/curly-newline': ["error", "always"];
190
191
  readonly '@stylistic/dot-location': ["error", "property"];
191
192
  readonly '@stylistic/eol-last': "error";
192
193
  readonly '@stylistic/func-call-spacing': ["error", "never"];
@@ -315,7 +316,9 @@ declare const config: {
315
316
  readonly 'n/no-exports-assign': "error";
316
317
  readonly 'n/no-extraneous-import': "error";
317
318
  readonly 'n/no-extraneous-require': "error";
318
- readonly 'n/no-missing-import': "error";
319
+ readonly 'n/no-missing-import': ["error", {
320
+ readonly ignoreTypeImport: true;
321
+ }];
319
322
  readonly 'n/no-missing-require': "error";
320
323
  readonly 'n/no-mixed-requires': "error";
321
324
  readonly 'n/no-new-require': "error";
package/dist/base.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import eslintRules from './rules/eslint-rules.js';
2
- // @ts-expect-error TS7016
3
- import { flatConfigs } from 'eslint-plugin-import';
4
2
  import globals from 'globals';
3
+ // @ts-expect-error TS7016
4
+ import importPlugin from 'eslint-plugin-import';
5
5
  import importRules from './rules/import-rules.js';
6
6
  import jsdoc from 'eslint-plugin-jsdoc';
7
7
  import jsdocRules from './rules/jsdoc-rules.js';
@@ -27,7 +27,7 @@ const config = {
27
27
  },
28
28
  plugins: {
29
29
  '@stylistic': stylistic,
30
- import: flatConfigs.recommended.plugins.import,
30
+ import: importPlugin,
31
31
  jsdoc,
32
32
  n: nPlugin
33
33
  },
package/dist/browser.d.ts CHANGED
@@ -1219,6 +1219,7 @@ declare const config: {
1219
1219
  }];
1220
1220
  readonly '@stylistic/comma-style': ["error", "last"];
1221
1221
  readonly '@stylistic/computed-property-spacing': ["error", "never"];
1222
+ readonly '@stylistic/curly-newline': ["error", "always"];
1222
1223
  readonly '@stylistic/dot-location': ["error", "property"];
1223
1224
  readonly '@stylistic/eol-last': "error";
1224
1225
  readonly '@stylistic/func-call-spacing': ["error", "never"];
@@ -1347,7 +1348,9 @@ declare const config: {
1347
1348
  readonly 'n/no-exports-assign': "error";
1348
1349
  readonly 'n/no-extraneous-import': "error";
1349
1350
  readonly 'n/no-extraneous-require': "error";
1350
- readonly 'n/no-missing-import': "error";
1351
+ readonly 'n/no-missing-import': ["error", {
1352
+ readonly ignoreTypeImport: true;
1353
+ }];
1351
1354
  readonly 'n/no-missing-require': "error";
1352
1355
  readonly 'n/no-mixed-requires': "error";
1353
1356
  readonly 'n/no-new-require': "error";
@@ -166,6 +166,7 @@ declare const config: {
166
166
  }];
167
167
  readonly '@stylistic/comma-style': ["error", "last"];
168
168
  readonly '@stylistic/computed-property-spacing': ["error", "never"];
169
+ readonly '@stylistic/curly-newline': ["error", "always"];
169
170
  readonly '@stylistic/dot-location': ["error", "property"];
170
171
  readonly '@stylistic/eol-last': "error";
171
172
  readonly '@stylistic/func-call-spacing': ["error", "never"];
@@ -294,7 +295,9 @@ declare const config: {
294
295
  readonly 'n/no-exports-assign': "error";
295
296
  readonly 'n/no-extraneous-import': "error";
296
297
  readonly 'n/no-extraneous-require': "error";
297
- readonly 'n/no-missing-import': "error";
298
+ readonly 'n/no-missing-import': ["error", {
299
+ readonly ignoreTypeImport: true;
300
+ }];
298
301
  readonly 'n/no-missing-require': "error";
299
302
  readonly 'n/no-mixed-requires': "error";
300
303
  readonly 'n/no-new-require': "error";
@@ -10,7 +10,9 @@ declare const rules: {
10
10
  readonly 'n/no-exports-assign': "error";
11
11
  readonly 'n/no-extraneous-import': "error";
12
12
  readonly 'n/no-extraneous-require': "error";
13
- readonly 'n/no-missing-import': "error";
13
+ readonly 'n/no-missing-import': ["error", {
14
+ readonly ignoreTypeImport: true;
15
+ }];
14
16
  readonly 'n/no-missing-require': "error";
15
17
  readonly 'n/no-mixed-requires': "error";
16
18
  readonly 'n/no-new-require': "error";
@@ -10,7 +10,7 @@ const rules = {
10
10
  'n/no-exports-assign': 'error',
11
11
  'n/no-extraneous-import': 'error',
12
12
  'n/no-extraneous-require': 'error',
13
- 'n/no-missing-import': 'error',
13
+ 'n/no-missing-import': ['error', { ignoreTypeImport: true }],
14
14
  'n/no-missing-require': 'error',
15
15
  'n/no-mixed-requires': 'error',
16
16
  'n/no-new-require': 'error',
@@ -21,6 +21,7 @@ declare const rules: {
21
21
  }];
22
22
  readonly '@stylistic/comma-style': ["error", "last"];
23
23
  readonly '@stylistic/computed-property-spacing': ["error", "never"];
24
+ readonly '@stylistic/curly-newline': ["error", "always"];
24
25
  readonly '@stylistic/dot-location': ["error", "property"];
25
26
  readonly '@stylistic/eol-last': "error";
26
27
  readonly '@stylistic/func-call-spacing': ["error", "never"];
@@ -33,6 +33,7 @@ const rules = {
33
33
  ],
34
34
  '@stylistic/comma-style': ['error', 'last'],
35
35
  '@stylistic/computed-property-spacing': ['error', 'never'],
36
+ '@stylistic/curly-newline': ['error', 'always'],
36
37
  '@stylistic/dot-location': ['error', 'property'],
37
38
  '@stylistic/eol-last': 'error',
38
39
  // Alias of `@stylistic/function-call-spacing`
@@ -1,4 +1,6 @@
1
1
  import type { ESLint, Linter } from 'eslint';
2
+ import type { configs } from 'typescript-eslint';
3
+ type ParserOptions = NonNullable<(NonNullable<typeof configs.base.languageOptions>)['parserOptions']>;
2
4
  declare const config: {
3
5
  readonly files: ["**/*.{ts,tsx,mts,cts}"];
4
6
  readonly languageOptions: {
@@ -175,6 +177,11 @@ declare const config: {
175
177
  readonly 'consistent-return': "off";
176
178
  readonly 'default-param-last': "off";
177
179
  readonly 'dot-notation': "off";
180
+ readonly 'import/default': "off";
181
+ readonly 'import/named': "off";
182
+ readonly 'import/namespace': "off";
183
+ readonly 'import/no-named-as-default-member': "off";
184
+ readonly 'import/no-unresolved': "off";
178
185
  readonly 'init-declarations': "off";
179
186
  readonly 'max-params': "off";
180
187
  readonly 'no-array-constructor': "off";
@@ -207,8 +214,6 @@ declare const config: {
207
214
  };
208
215
  };
209
216
  };
210
- declare const typescriptConfig: (parserOptions: Readonly<{
211
- project: readonly string[] | boolean | string;
212
- }>) => Linter.FlatConfig;
217
+ declare const typescriptConfig: (parserOptions: ParserOptions) => Linter.FlatConfig;
213
218
  export { config as typescript, typescriptConfig };
214
219
  export default config;
@@ -179,6 +179,11 @@ const config = {
179
179
  'consistent-return': 'off',
180
180
  'default-param-last': 'off',
181
181
  'dot-notation': 'off',
182
+ 'import/default': 'off',
183
+ 'import/named': 'off',
184
+ 'import/namespace': 'off',
185
+ 'import/no-named-as-default-member': 'off',
186
+ 'import/no-unresolved': 'off',
182
187
  'init-declarations': 'off',
183
188
  'max-params': 'off',
184
189
  'no-array-constructor': 'off',
@@ -222,13 +227,13 @@ const config = {
222
227
  }
223
228
  }
224
229
  };
230
+ // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
225
231
  const typescriptConfig = (parserOptions) => ({
226
232
  ...config,
227
233
  languageOptions: {
228
234
  ...config.languageOptions,
229
235
  parserOptions: {
230
- ...config.languageOptions.parserOptions,
231
- projectService: false,
236
+ sourceType: 'module',
232
237
  ...parserOptions
233
238
  }
234
239
  }
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@egy186/eslint-config",
3
3
  "description": "Eslint shareable config",
4
- "version": "1.1.0",
4
+ "version": "1.3.0",
5
5
  "author": "egy186",
6
6
  "bugs": {
7
7
  "url": "https://github.com/egy186/eslint-config/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@stylistic/eslint-plugin": "~2.8.0",
10
+ "@stylistic/eslint-plugin": "~2.9.0",
11
11
  "eslint-plugin-import": "~2.31.0",
12
12
  "eslint-plugin-jsdoc": "~50.3.1",
13
- "eslint-plugin-n": "~17.10.3",
14
- "globals": "^15.10.0"
13
+ "eslint-plugin-n": "~17.11.1",
14
+ "globals": "^15.11.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@eslint-stylistic/metadata": "~2.8.0",
17
+ "@eslint-stylistic/metadata": "~2.9.0",
18
18
  "@eslint/compat": "~1.1.1",
19
19
  "@eslint/js": "~8.57.0",
20
20
  "@types/eslint": "^8.56.12",
21
21
  "@types/eslint__js": "^8.42.3",
22
- "@types/node": "^20.16.10",
22
+ "@types/node": "^20.16.11",
23
23
  "eslint": "~8.57.1",
24
24
  "eslint-import-resolver-typescript": "~3.6.3",
25
25
  "eslint-plugin-jest": "~28.8.3",
26
26
  "eslint-plugin-react": "~7.37.1",
27
27
  "eslint-plugin-react-hooks": "~4.6.2",
28
28
  "husky": "^9.1.6",
29
- "jiti": "^1.21.6",
29
+ "jiti": "^2.3.3",
30
30
  "typescript": "~5.5.4",
31
- "typescript-eslint": "~8.8.0"
31
+ "typescript-eslint": "~8.8.1"
32
32
  },
33
33
  "engines": {
34
34
  "node": ">=18.18.0"
@@ -104,7 +104,7 @@
104
104
  "lint": "eslint .",
105
105
  "prepare": "husky",
106
106
  "test": "jiti test/test.ts",
107
- "typecheck": "tsc --project tsconfig.base.json --noEmit"
107
+ "typecheck": "tsc --project tsconfig.typecheck.json"
108
108
  },
109
109
  "type": "module",
110
110
  "types": "./dist/index.d.ts"