@dr.pogodin/eslint-configs 0.2.4 → 0.2.6

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.
@@ -11,7 +11,10 @@ import babelPlugin from '@babel/eslint-plugin';
11
11
  import js from '@eslint/js';
12
12
  import stylisticPlugin from '@stylistic/eslint-plugin';
13
13
 
14
- function newConfig({ noPerf } = {}) {
14
+ export function newJsConfig({
15
+ noPerf,
16
+ perfectionistTsConfig,
17
+ } = {}) {
15
18
  const extentions = [
16
19
  'js/recommended',
17
20
  '@stylistic/recommended',
@@ -296,7 +299,7 @@ function newConfig({ noPerf } = {}) {
296
299
  partitionByNewLine: true,
297
300
  };
298
301
 
299
- rules['perfectionist/sort-imports'] = ['error', {
302
+ const sortImporsOptions = {
300
303
  alphabet,
301
304
  groups: [
302
305
  'builtin',
@@ -312,7 +315,13 @@ function newConfig({ noPerf } = {}) {
312
315
  newlinesInside: 'ignore',
313
316
  partitionByNewLine: false,
314
317
  type: 'custom',
315
- }];
318
+ };
319
+
320
+ if (perfectionistTsConfig) {
321
+ sortImporsOptions.tsconfig = perfectionistTsConfig;
322
+ }
323
+
324
+ rules['perfectionist/sort-imports'] = ['error', sortImporsOptions];
316
325
  }
317
326
 
318
327
  return defineConfig([{
@@ -335,6 +344,6 @@ function newConfig({ noPerf } = {}) {
335
344
  }]);
336
345
  }
337
346
 
338
- export const javascriptNoPerf = newConfig({ noPerf: true });
347
+ export const javascriptNoPerf = newJsConfig({ noPerf: true });
339
348
 
340
- export default newConfig();
349
+ export default newJsConfig();
@@ -1,10 +1,17 @@
1
1
  import { defineConfig } from 'eslint/config';
2
2
  import tsEsLint from 'typescript-eslint';
3
3
 
4
- import jsConfig, { javascriptNoPerf } from './javascript.js';
4
+ import { newJsConfig } from './javascript.js';
5
5
 
6
6
  function newConfig({ noPerf } = {}) {
7
- let extentions = [
7
+ const jsConfig = newJsConfig({
8
+ noPerf,
9
+ perfectionistTsConfig: {
10
+ rootDir: '.',
11
+ },
12
+ });
13
+
14
+ const extentions = [
8
15
  jsConfig,
9
16
  tsEsLint.configs.recommendedTypeChecked,
10
17
  tsEsLint.configs.stylisticTypeChecked,
@@ -91,11 +98,7 @@ function newConfig({ noPerf } = {}) {
91
98
  '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
92
99
  };
93
100
 
94
- if (noPerf) {
95
- extentions = [javascriptNoPerf, ...extentions];
96
- } else {
97
- extentions = [jsConfig, ...extentions];
98
-
101
+ if (!noPerf) {
99
102
  rules['adjacent-overload-signatures'] = 'off';
100
103
  }
101
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dr.pogodin/eslint-configs",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "ESLint configurations for TypeScript and/or React projects",
5
5
  "type": "module",
6
6
  "main": "./config/index.js",
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "@babel/eslint-parser": "^7.28.6",
33
33
  "@babel/eslint-plugin": "^7.27.1",
34
- "@babel/preset-env": "^7.28.6",
34
+ "@babel/preset-env": "^7.29.0",
35
35
  "@babel/preset-react": "^7.28.5",
36
36
  "@babel/preset-typescript": "^7.28.5",
37
37
  "@eslint/js": "^9.39.2",