@deot/dev-eslint 2.8.4 → 2.9.1

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/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ const js = require('@eslint/js');
8
8
  const globals = require('globals');
9
9
  const pluginJsdoc = require('eslint-plugin-jsdoc');
10
10
  const pluginMarkdown = require('eslint-plugin-markdown');
11
- const pluginImport = require('eslint-plugin-import');
11
+ const pluginImport = require('eslint-plugin-import-x');
12
12
  const pluginStylistic = require('@stylistic/eslint-plugin');
13
13
 
14
14
  function _interopNamespaceDefault(e) {
@@ -95,7 +95,6 @@ const typescript = async (options$) => {
95
95
  "@typescript-eslint/no-shadow": 2,
96
96
  // https://github.com/typescript-eslint/typescript-eslint/issues/2483
97
97
  "@typescript-eslint/no-unused-vars": 1,
98
- "@typescript-eslint/member-delimiter-style": 1,
99
98
  // ignore duplicate rules
100
99
  "no-unused-vars": 0
101
100
  };
@@ -206,7 +205,7 @@ const markdown = async (options$) => {
206
205
  if (!options.enable) {
207
206
  return [];
208
207
  }
209
- const config = pluginMarkdown.configs.recommended.overrides[1];
208
+ const config = pluginMarkdown.configs.recommended[2];
210
209
  return [
211
210
  {
212
211
  plugins: {
@@ -283,14 +282,18 @@ const imports = async (options$) => {
283
282
  const recommendedRules = pluginImport.configs.recommended.rules;
284
283
  const rules = {
285
284
  ...recommendedRules,
286
- "import/newline-after-import": 1,
287
- "import/no-unresolved": 0
285
+ "import-x/newline-after-import": 1,
286
+ "import-x/no-unresolved": 0,
287
+ "import-x/namespace": 0,
288
+ "import-x/default": 0,
289
+ "import-x/no-named-as-default": 0,
290
+ "import-x/no-named-as-default-member": 0
288
291
  };
289
292
  return [
290
293
  // 单独安装plugins,
291
294
  {
292
295
  plugins: {
293
- import: pluginImport
296
+ "import-x": pluginImport
294
297
  },
295
298
  settings: {
296
299
  "import/parsers": {
@@ -303,7 +306,7 @@ const imports = async (options$) => {
303
306
  ...cleanRules(
304
307
  "import",
305
308
  Object.keys(pluginImport.rules).reduce((pre, key) => {
306
- pre[`import/${key}`] = 2;
309
+ pre[`import-x/${key}`] = 2;
307
310
  return pre;
308
311
  }, {}),
309
312
  recommendedRules,
@@ -340,7 +343,8 @@ const stylistic = async (options$) => {
340
343
  allowSingleLine: true
341
344
  }],
342
345
  "@stylistic/member-delimiter-style": 1,
343
- "@stylistic/max-statements-per-line": ["off", { max: 1 }]
346
+ "@stylistic/max-statements-per-line": ["off", { max: 1 }],
347
+ "@stylistic/max-len": [1, { code: 150 }]
344
348
  };
345
349
  return [
346
350
  // 单独安装plugins, 方便扩展
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import js from '@eslint/js';
4
4
  import globals from 'globals';
5
5
  import pluginJsdoc from 'eslint-plugin-jsdoc';
6
6
  import pluginMarkdown from 'eslint-plugin-markdown';
7
- import pluginImport from 'eslint-plugin-import';
7
+ import pluginImport from 'eslint-plugin-import-x';
8
8
  import pluginStylistic from '@stylistic/eslint-plugin';
9
9
 
10
10
  const pickOptions = async (key, options) => {
@@ -72,7 +72,6 @@ const typescript = async (options$) => {
72
72
  "@typescript-eslint/no-shadow": 2,
73
73
  // https://github.com/typescript-eslint/typescript-eslint/issues/2483
74
74
  "@typescript-eslint/no-unused-vars": 1,
75
- "@typescript-eslint/member-delimiter-style": 1,
76
75
  // ignore duplicate rules
77
76
  "no-unused-vars": 0
78
77
  };
@@ -183,7 +182,7 @@ const markdown = async (options$) => {
183
182
  if (!options.enable) {
184
183
  return [];
185
184
  }
186
- const config = pluginMarkdown.configs.recommended.overrides[1];
185
+ const config = pluginMarkdown.configs.recommended[2];
187
186
  return [
188
187
  {
189
188
  plugins: {
@@ -260,14 +259,18 @@ const imports = async (options$) => {
260
259
  const recommendedRules = pluginImport.configs.recommended.rules;
261
260
  const rules = {
262
261
  ...recommendedRules,
263
- "import/newline-after-import": 1,
264
- "import/no-unresolved": 0
262
+ "import-x/newline-after-import": 1,
263
+ "import-x/no-unresolved": 0,
264
+ "import-x/namespace": 0,
265
+ "import-x/default": 0,
266
+ "import-x/no-named-as-default": 0,
267
+ "import-x/no-named-as-default-member": 0
265
268
  };
266
269
  return [
267
270
  // 单独安装plugins,
268
271
  {
269
272
  plugins: {
270
- import: pluginImport
273
+ "import-x": pluginImport
271
274
  },
272
275
  settings: {
273
276
  "import/parsers": {
@@ -280,7 +283,7 @@ const imports = async (options$) => {
280
283
  ...cleanRules(
281
284
  "import",
282
285
  Object.keys(pluginImport.rules).reduce((pre, key) => {
283
- pre[`import/${key}`] = 2;
286
+ pre[`import-x/${key}`] = 2;
284
287
  return pre;
285
288
  }, {}),
286
289
  recommendedRules,
@@ -317,7 +320,8 @@ const stylistic = async (options$) => {
317
320
  allowSingleLine: true
318
321
  }],
319
322
  "@stylistic/member-delimiter-style": 1,
320
- "@stylistic/max-statements-per-line": ["off", { max: 1 }]
323
+ "@stylistic/max-statements-per-line": ["off", { max: 1 }],
324
+ "@stylistic/max-len": [1, { code: 150 }]
321
325
  };
322
326
  return [
323
327
  // 单独安装plugins, 方便扩展
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@deot/dev-eslint",
3
- "version": "2.8.4",
3
+ "version": "2.9.1",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
+ "types": "./dist/index.d.ts",
9
10
  "import": "./dist/index.js",
10
- "require": "./dist/index.cjs",
11
- "types": "./dist/index.d.ts"
11
+ "require": "./dist/index.cjs"
12
12
  }
13
13
  },
14
14
  "files": [
@@ -19,16 +19,16 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@stylistic/eslint-plugin": "^1.5.1",
23
- "@typescript-eslint/eslint-plugin": "^6.14.0",
24
- "@typescript-eslint/parser": "^6.14.0",
25
- "eslint-plugin-import": "^2.29.0",
26
- "eslint-plugin-jsdoc": "^46.9.1",
27
- "eslint-plugin-markdown": "^3.0.1",
28
- "globals": "^13.24.0"
22
+ "@stylistic/eslint-plugin": "^4.2.0",
23
+ "@typescript-eslint/eslint-plugin": "^8.29.0",
24
+ "@typescript-eslint/parser": "^8.29.0",
25
+ "eslint-plugin-import-x": "^4.10.0",
26
+ "eslint-plugin-jsdoc": "^50.6.9",
27
+ "eslint-plugin-markdown": "^5.1.0",
28
+ "globals": "^16.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/eslint": "^8.44.9",
32
- "eslint": "^8.55.0"
31
+ "@types/eslint": "^9.6.1",
32
+ "eslint": "^9.23.0"
33
33
  }
34
34
  }