@alexlit/lint-kit 171.0.0 → 172.0.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/eslint.config.js CHANGED
@@ -7,16 +7,9 @@ import {
7
7
  export default [
8
8
  ...defaultPreset,
9
9
 
10
- {
11
- ignores: ['packages/config-eslint/_legacy'],
12
- },
10
+ { ignores: ['packages/config-eslint/_legacy'] },
13
11
 
14
- {
15
- files: ['packages/**'],
16
- rules: {
17
- 'no-restricted-imports': 'off',
18
- },
19
- },
12
+ { files: ['packages/**'], rules: { 'no-restricted-imports': 'off' } },
20
13
 
21
14
  ...tailwindcss,
22
15
  ...prettierConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/lint-kit",
3
- "version": "171.0.0",
3
+ "version": "172.0.0",
4
4
  "private": false,
5
5
  "description": "Preset of configuration files and dependencies for linting web applications (designed for Vue.js with TypeScript)",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "129.2.0",
3
+ "version": "130.0.0",
4
4
  "private": false,
5
5
  "description": "Sharable ESLint configuration",
6
6
  "keywords": [
@@ -40,27 +40,27 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@eslint/js": "^9.39.2",
43
- "@eslint/json": "^0.14.0",
43
+ "@eslint/json": "^1.0.0",
44
44
  "@intlify/eslint-plugin-vue-i18n": "^4.1.1",
45
45
  "@stylistic/eslint-plugin": "^5.7.1",
46
46
  "@tanstack/eslint-plugin-query": "^5.91.3",
47
47
  "@unocss/eslint-config": "^66.6.0",
48
48
  "eslint": "9.39.2",
49
49
  "eslint-config-prettier": "^10.1.8",
50
- "eslint-plugin-jsdoc": "^62.4.1",
50
+ "eslint-plugin-jsdoc": "^62.5.0",
51
51
  "eslint-plugin-perfectionist": "^5.4.0",
52
52
  "eslint-plugin-prettier": "^5.5.5",
53
53
  "eslint-plugin-regexp": "^3.0.0",
54
- "eslint-plugin-sonarjs": "^3.0.5",
54
+ "eslint-plugin-sonarjs": "^3.0.6",
55
55
  "eslint-plugin-tailwindcss": "^3.18.2",
56
56
  "eslint-plugin-unicorn": "^62.0.0",
57
57
  "eslint-plugin-vitest": "^0.5.4",
58
58
  "eslint-plugin-vue": "^10.7.0",
59
59
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
60
- "globals": "^17.1.0",
60
+ "globals": "^17.2.0",
61
61
  "jsonc-eslint-parser": "^2.4.2",
62
62
  "typescript": "^5.9.3",
63
- "typescript-eslint": "^8.53.1",
63
+ "typescript-eslint": "^8.54.0",
64
64
  "yaml-eslint-parser": "^2.0.0"
65
65
  },
66
66
  "publishConfig": {
@@ -1,9 +1,10 @@
1
1
  import plugin from '@eslint/js';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [eslint](https://eslint.org) */
6
- export const javascript = [
7
+ export const javascript = defineConfig([
7
8
  { files: FILES, ...plugin.configs.recommended },
8
9
  {
9
10
  files: FILES,
@@ -38,4 +39,4 @@ export const javascript = [
38
39
  'prefer-template': 'warn',
39
40
  },
40
41
  },
41
- ];
42
+ ]);
@@ -1,9 +1,10 @@
1
1
  import plugin from 'eslint-plugin-jsdoc';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) */
6
- export const jsdoc = [
7
+ export const jsdoc = defineConfig([
7
8
  { files: FILES, ...plugin.configs['flat/recommended'] },
8
9
  {
9
10
  files: FILES,
@@ -32,4 +33,4 @@ export const jsdoc = [
32
33
  'jsdoc/tag-lines': 'off',
33
34
  },
34
35
  },
35
- ];
36
+ ]);
@@ -1,34 +1,27 @@
1
1
  import plugin from '@eslint/json';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  /** @see [eslint/json](https://github.com/eslint/json) */
4
- export const json = [
5
- // json
5
+ export const json = defineConfig([
6
6
  {
7
+ extends: ['json/recommended'],
7
8
  files: ['**/*.json'],
8
9
  ignores: ['**/package-lock.json'],
9
10
  language: 'json/json',
10
- ...plugin.configs.recommended,
11
- },
12
- {
13
- files: ['**/*.json'],
14
- ignores: ['**/package.json', '**/package-lock.json'],
15
- rules: {
16
- 'json/sort-keys': 'warn',
17
- 'json/top-level-interop': 'error',
18
- },
11
+ plugins: { json: plugin },
19
12
  },
20
13
 
21
- // jsonc
22
14
  {
15
+ extends: ['json/recommended'],
23
16
  files: ['**/*.jsonc'],
24
17
  language: 'json/jsonc',
25
- ...plugin.configs.recommended,
18
+ plugins: { json: plugin },
26
19
  },
27
20
 
28
- // json5
29
21
  {
22
+ extends: ['json/recommended'],
30
23
  files: ['**/*.json5'],
31
24
  language: 'json/json5',
32
- ...plugin.configs.recommended,
25
+ plugins: { json: plugin },
33
26
  },
34
- ];
27
+ ]);
@@ -1,9 +1,10 @@
1
1
  import plugin from 'eslint-plugin-perfectionist';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [eslint-plugin-perfectionist](https://perfectionist.dev) */
6
- export const perfectionist = [
7
+ export const perfectionist = defineConfig([
7
8
  { files: FILES, ...plugin.configs['recommended-natural'] },
8
9
  {
9
10
  files: FILES,
@@ -29,4 +30,4 @@ export const perfectionist = [
29
30
  ],
30
31
  },
31
32
  },
32
- ];
33
+ ]);
@@ -1,5 +1,6 @@
1
1
  import config from 'eslint-config-prettier';
2
2
  import plugin from 'eslint-plugin-prettier/recommended';
3
+ import { defineConfig } from 'eslint/config';
3
4
 
4
5
  import { FILES } from '../presets/base.js';
5
6
 
@@ -16,13 +17,13 @@ const fixes = {
16
17
  };
17
18
 
18
19
  /** @see [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) */
19
- export const prettier = [
20
+ export const prettier = defineConfig([
20
21
  { files: FILES, ...plugin },
21
22
  { files: ['**/*.vue'], rules: { ...fixes } },
22
- ];
23
+ ]);
23
24
 
24
25
  /** @see [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) */
25
- export const prettierConfig = [
26
+ export const prettierConfig = defineConfig([
26
27
  { files: FILES, ...config },
27
28
  { files: ['**/*.vue'], rules: { ...fixes } },
28
- ];
29
+ ]);
@@ -1,6 +1,9 @@
1
1
  import plugin from 'eslint-plugin-regexp';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [eslint-plugin-regexp](https://github.com/ota-meshi/eslint-plugin-regexp) */
6
- export const regexp = [{ files: FILES, ...plugin.configs['flat/recommended'] }];
7
+ export const regexp = defineConfig([
8
+ { files: FILES, ...plugin.configs['flat/recommended'] },
9
+ ]);
@@ -1,9 +1,10 @@
1
1
  import plugin from 'eslint-plugin-sonarjs';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
- /** @see [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs) */
6
- export const sonar = [
6
+ /** @see [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md) */
7
+ export const sonar = defineConfig([
7
8
  { files: FILES, ...plugin.configs.recommended },
8
9
  {
9
10
  files: FILES,
@@ -14,4 +15,4 @@ export const sonar = [
14
15
  'sonarjs/todo-tag': 'warn',
15
16
  },
16
17
  },
17
- ];
18
+ ]);
@@ -1,10 +1,19 @@
1
1
  import plugin from '@stylistic/eslint-plugin';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [@stylistic/eslint-plugin](https://eslint.style/) */
6
- export const stylistic = [
7
- plugin.configs.recommended,
7
+ export const stylistic = defineConfig([
8
+ {
9
+ ...plugin.configs.recommended,
10
+ ignores: [
11
+ ...(plugin.configs.recommended.ignores ?? []),
12
+ '**/*.json',
13
+ '**/*.jsonc',
14
+ '**/*.json5',
15
+ ],
16
+ },
8
17
  {
9
18
  files: FILES,
10
19
  plugins: { '@stylistic': plugin },
@@ -99,4 +108,4 @@ export const stylistic = [
99
108
  ],
100
109
  },
101
110
  },
102
- ];
111
+ ]);
@@ -1,8 +1,10 @@
1
+ import { defineConfig } from 'eslint/config';
2
+
1
3
  // import tailwind from 'eslint-plugin-tailwindcss';
2
4
  import { FILES } from '../presets/base.js';
3
5
 
4
6
  /** @see [eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss) */
5
- export const tailwindcss = [
7
+ export const tailwindcss = defineConfig([
6
8
  // TODO: включить после обновления плагина
7
9
  // ...tailwind.configs['flat/recommended'],
8
10
  {
@@ -26,4 +28,4 @@ export const tailwindcss = [
26
28
  // },
27
29
  // },
28
30
  },
29
- ];
31
+ ]);
@@ -1,4 +1,7 @@
1
1
  import plugin from '@tanstack/eslint-plugin-query';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  /** @see [@tanstack/query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query) */
4
- export const tanstackQuery = [...plugin.configs['flat/recommended']];
5
+ export const tanstackQuery = defineConfig([
6
+ ...plugin.configs['flat/recommended'],
7
+ ]);
@@ -1,10 +1,11 @@
1
1
  /* eslint-disable unicorn/no-null */
2
+ import { defineConfig } from 'eslint/config';
2
3
  import plugin from 'typescript-eslint';
3
4
 
4
5
  import { FILES } from '../presets/base.js';
5
6
 
6
7
  /** @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) */
7
- export const typescript = [
8
+ export const typescript = defineConfig([
8
9
  ...plugin.configs.strict,
9
10
  ...plugin.configs.stylistic,
10
11
 
@@ -50,4 +51,4 @@ export const typescript = [
50
51
  ],
51
52
  },
52
53
  },
53
- ];
54
+ ]);
@@ -1,9 +1,10 @@
1
1
  import plugin from 'eslint-plugin-unicorn';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) */
6
- export const unicorn = [
7
+ export const unicorn = defineConfig([
7
8
  { files: FILES, ...plugin.configs['flat/all'] },
8
9
  {
9
10
  files: FILES,
@@ -53,4 +54,4 @@ export const unicorn = [
53
54
  },
54
55
  { files: ['.*'], rules: { 'unicorn/no-null': 'off' } },
55
56
  { files: ['*.d.ts'], rules: { 'unicorn/prefer-export-from': 'off' } },
56
- ];
57
+ ]);
@@ -1,9 +1,10 @@
1
1
  import plugin from '@unocss/eslint-config/flat';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  import { FILES } from '../presets/base.js';
4
5
 
5
6
  /** @see [@unocss/eslint-config](https://unocss.dev/integrations/eslint) */
6
- export const unocss = [
7
+ export const unocss = defineConfig([
7
8
  { files: FILES, ...plugin },
8
9
  { files: FILES, rules: { 'unocss/order-attributify': 'off' } },
9
- ];
10
+ ]);
@@ -1,12 +1,11 @@
1
1
  import plugin from 'eslint-plugin-vitest';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  /** @see [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) */
4
- export const vitest = [
5
+ export const vitest = defineConfig([
5
6
  {
6
7
  files: ['*.{test,spec}.{js,ts}'],
7
- plugins: {
8
- vitest: plugin,
9
- },
8
+ plugins: { vitest: plugin },
10
9
  rules: {
11
10
  ...plugin.configs.all.rules,
12
11
 
@@ -16,4 +15,4 @@ export const vitest = [
16
15
  'vitest/require-to-throw-message': 'off',
17
16
  },
18
17
  },
19
- ];
18
+ ]);
@@ -1,7 +1,8 @@
1
1
  import plugin from 'eslint-plugin-vuejs-accessibility';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  /** @see [eslint-plugin-vuejs-accessibility](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/) */
4
- export const vueAccessibility = [
5
+ export const vueAccessibility = defineConfig([
5
6
  ...plugin.configs['flat/recommended'],
6
7
 
7
8
  {
@@ -9,14 +10,9 @@ export const vueAccessibility = [
9
10
  rules: {
10
11
  'vuejs-accessibility/label-has-for': [
11
12
  'warn',
12
- {
13
- allowChildren: true,
14
- required: {
15
- some: ['nesting', 'id'],
16
- },
17
- },
13
+ { allowChildren: true, required: { some: ['nesting', 'id'] } },
18
14
  ],
19
15
  'vuejs-accessibility/no-autofocus': ['warn', { ignoreNonDOM: true }],
20
16
  },
21
17
  },
22
- ];
18
+ ]);
@@ -1,7 +1,8 @@
1
1
  import plugin from '@intlify/eslint-plugin-vue-i18n';
2
+ import { defineConfig } from 'eslint/config';
2
3
 
3
4
  /** @see [eslint-plugin-vue-i18n](https://eslint-plugin-vue-i18n.intlify.dev/) */
4
- export const vueI18n = [
5
+ export const vueI18n = defineConfig([
5
6
  ...plugin.configs['flat/recommended'].map((config) => ({
6
7
  ...config,
7
8
  ignores: [
@@ -18,15 +19,11 @@ export const vueI18n = [
18
19
  '@intlify/vue-i18n/key-format-style': [
19
20
  'error',
20
21
  'snake_case',
21
- {
22
- allowArray: false,
23
- },
22
+ { allowArray: false },
24
23
  ],
25
24
  '@intlify/vue-i18n/no-duplicate-keys-in-locale': [
26
25
  'error',
27
- {
28
- ignoreI18nBlock: false,
29
- },
26
+ { ignoreI18nBlock: false },
30
27
  ],
31
28
  '@intlify/vue-i18n/no-dynamic-keys': 'warn',
32
29
  '@intlify/vue-i18n/no-raw-text': 'off',
@@ -42,4 +39,4 @@ export const vueI18n = [
42
39
  },
43
40
  },
44
41
  },
45
- ];
42
+ ]);
@@ -1,8 +1,9 @@
1
1
  import plugin from 'eslint-plugin-vue';
2
+ import { defineConfig } from 'eslint/config';
2
3
  import typescript from 'typescript-eslint';
3
4
 
4
5
  /** @see [eslint-plugin-vue](https://eslint.vuejs.org/rules/) */
5
- export const vue = [
6
+ export const vue = defineConfig([
6
7
  ...plugin.configs['flat/recommended'].map((config) => ({
7
8
  ...config,
8
9
  ignores: [
@@ -183,4 +184,4 @@ export const vue = [
183
184
  files: ['**/pages/**/*.vue', '**/layouts/**/*.vue'],
184
185
  rules: { 'vue/multi-word-component-names': 'off' },
185
186
  },
186
- ];
187
+ ]);
@@ -1,9 +1,10 @@
1
+ import { defineConfig } from 'eslint/config';
1
2
  import globals from 'globals';
2
3
 
3
4
  export const FILES = ['**/*.{js,mjs,cjs,jsx,ts,tsx,vue}'];
4
5
 
5
6
  /** Base config */
6
- export const base = [
7
+ export const base = defineConfig([
7
8
  { files: FILES, languageOptions: { globals: globals.browser } },
8
9
  {
9
10
  ignores: [
@@ -18,4 +19,4 @@ export const base = [
18
19
  'sw.js',
19
20
  ],
20
21
  },
21
- ];
22
+ ]);
@@ -1,3 +1,5 @@
1
+ import { defineConfig } from 'eslint/config';
2
+
1
3
  import { javascript } from '../plugins/javascript.js';
2
4
  import { jsdoc } from '../plugins/jsdoc.js';
3
5
  import { json } from '../plugins/json.js';
@@ -15,7 +17,7 @@ import { vueI18n } from '../plugins/vue-i18n.js';
15
17
  import { vue } from '../plugins/vue.js';
16
18
  import { base } from './base.js';
17
19
 
18
- export const defaultPreset = [
20
+ export const defaultPreset = defineConfig([
19
21
  ...base, // must be first
20
22
 
21
23
  ...javascript,
@@ -34,4 +36,4 @@ export const defaultPreset = [
34
36
  ...vueI18n,
35
37
 
36
38
  ...prettierConfig, // must be last
37
- ];
39
+ ]);
@@ -4,7 +4,7 @@ source "$(dirname $0)"/../bash.config.sh
4
4
 
5
5
  OPTION=${1}
6
6
 
7
- FILES='./**/*{.cjs,.mjs,.js,.jsx,.ts,.tsx,.vue}'
7
+ FILES='./**/*{.cjs,.mjs,.js,.jsx,.ts,.tsx,.vue,.json}'
8
8
 
9
9
  echo -e "${YELLOW}eslint ${GREY}-> ${CYAN}${FILES}${WHITE}"
10
10