@ocavue/eslint-config 1.10.1 → 1.11.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.
@@ -1 +1 @@
1
- {"version":3,"file":"antfu.d.ts","sourceRoot":"","sources":["../../src/antfu.js"],"names":[],"mappings":"AAEA,mGAeC"}
1
+ {"version":3,"file":"antfu.d.ts","sourceRoot":"","sources":["../../src/antfu.js"],"names":[],"mappings":"AAEA,mGAgBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/imports.js"],"names":[],"mappings":"AAKA,qGA2CC"}
1
+ {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/imports.js"],"names":[],"mappings":"AAIA,qGA6CC"}
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AAYA,wGAqFC;;qBA5FoB,mBAAmB"}
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AAWA,wGA8FC;;qBApGoB,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/vue.js"],"names":[],"mappings":"AAYA,iGAyBC"}
1
+ {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../src/vue.js"],"names":[],"mappings":"AAYA,iGAgCC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocavue/eslint-config",
3
3
  "type": "module",
4
- "version": "1.10.1",
4
+ "version": "1.11.0",
5
5
  "packageManager": "pnpm@8.15.9",
6
6
  "description": "",
7
7
  "author": "ocavue <ocavue@gmail.com>",
@@ -39,7 +39,7 @@
39
39
  "eslint-import-resolver-typescript": "^3.6.1",
40
40
  "eslint-plugin-antfu": "^2.3.4",
41
41
  "eslint-plugin-deprecation": "^3.0.0",
42
- "eslint-plugin-import": "^2.29.1",
42
+ "eslint-plugin-import-x": "^3.1.0",
43
43
  "eslint-plugin-jsonc": "^2.16.0",
44
44
  "eslint-plugin-markdown": "^5.1.0",
45
45
  "eslint-plugin-no-only-tests": "^3.1.0",
package/src/antfu.js CHANGED
@@ -9,6 +9,7 @@ export function antfu() {
9
9
  antfu: antfuPlugin,
10
10
  },
11
11
  rules: {
12
+ 'antfu/import-dedupe': 'error',
12
13
  'antfu/top-level-function': 'error',
13
14
  },
14
15
  },
package/src/imports.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // @ts-check
2
2
 
3
- // @ts-expect-error no type
4
- import importPlugin from 'eslint-plugin-import'
3
+ import * as importPlugin from 'eslint-plugin-import-x'
5
4
 
6
5
  export function imports() {
7
6
  /** @type {import('eslint').Linter.FlatConfig[]} */
@@ -9,6 +8,7 @@ export function imports() {
9
8
  {
10
9
  name: 'import',
11
10
  plugins: {
11
+ // @ts-expect-error incorrect type
12
12
  import: importPlugin,
13
13
  },
14
14
  settings: {
@@ -26,6 +26,7 @@ export function imports() {
26
26
  'import/no-mutable-exports': 'warn',
27
27
  'import/no-useless-path-segments': 'warn',
28
28
  'import/newline-after-import': 'warn',
29
+ 'import/no-duplicates': 'warn',
29
30
  'import/order': [
30
31
  'warn',
31
32
  {
package/src/typescript.js CHANGED
@@ -6,7 +6,6 @@ import deprecationPlugin from 'eslint-plugin-deprecation'
6
6
  import tseslint from 'typescript-eslint'
7
7
 
8
8
  import { GLOB_JS, GLOB_JSX, GLOB_TEST, GLOB_TS, GLOB_TSX } from './shared.js'
9
- import { typescriptLanguageOptions } from './typescript-language-options.js'
10
9
 
11
10
  export { tseslint }
12
11
 
@@ -20,7 +19,15 @@ export function typescript() {
20
19
  {
21
20
  name: 'typescript',
22
21
  files: [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
23
- languageOptions: typescriptLanguageOptions,
22
+ languageOptions: {
23
+ // @ts-expect-error: conflict type
24
+ parser: tseslint.parser,
25
+ parserOptions: {
26
+ project: true,
27
+ sourceType: 'module',
28
+ ecmaVersion: 'latest',
29
+ },
30
+ },
24
31
  plugins: {
25
32
  // @ts-expect-error: conflict type
26
33
  '@typescript-eslint': tseslint.plugin,
@@ -36,7 +43,8 @@ export function typescript() {
36
43
  '@typescript-eslint/consistent-indexed-object-style': 'off',
37
44
  '@typescript-eslint/array-type': 'off',
38
45
  '@typescript-eslint/dot-notation': 'off',
39
- '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'warn',
46
+ '@typescript-eslint/no-unnecessary-parameter-property-assignment':
47
+ 'warn',
40
48
  '@typescript-eslint/restrict-plus-operands': 'warn',
41
49
  '@typescript-eslint/no-unsafe-call': 'warn',
42
50
  '@typescript-eslint/no-unsafe-return': 'warn',
package/src/vue.js CHANGED
@@ -2,25 +2,32 @@
2
2
 
3
3
  import prettierConfig from 'eslint-config-prettier'
4
4
  // @ts-expect-error no types
5
- import pluginVue from 'eslint-plugin-vue'
5
+ import vuePlugin from 'eslint-plugin-vue'
6
+ import tseslint from 'typescript-eslint'
6
7
 
7
8
  import { GLOB_VUE } from './shared.js'
8
- import { typescriptLanguageOptions } from './typescript-language-options.js'
9
9
 
10
- /** @type {import('eslint').Linter.FlatConfig} */
11
- const vueRecommended = pluginVue.configs['flat/recommended']
10
+ /** @type {import('eslint').Linter.FlatConfig[]} */
11
+ const vueRecommended = vuePlugin.configs['flat/recommended']
12
12
 
13
13
  export function vue() {
14
14
  /** @type {import('eslint').Linter.FlatConfig[]} */
15
15
  const config = [
16
+ ...vueRecommended,
16
17
  {
17
- ...vueRecommended,
18
- name: 'vue',
18
+ name: 'vue:language-options',
19
19
  files: [GLOB_VUE],
20
- languageOptions: typescriptLanguageOptions,
20
+ languageOptions: {
21
+ parserOptions: {
22
+ parser: tseslint.parser,
23
+ sourceType: 'module',
24
+ ecmaVersion: 'latest',
25
+ },
26
+ },
27
+ },
28
+ {
29
+ name: 'vue:rules-override',
21
30
  rules: {
22
- ...vueRecommended.rules,
23
-
24
31
  ...Object.fromEntries(
25
32
  Object.entries(prettierConfig.rules)
26
33
  .filter(([key]) => key.startsWith('vue/'))
@@ -1,3 +0,0 @@
1
- /** @type {import('eslint').Linter.FlatConfig['languageOptions']} */
2
- export const typescriptLanguageOptions: import("eslint").Linter.FlatConfig["languageOptions"];
3
- //# sourceMappingURL=typescript-language-options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript-language-options.d.ts","sourceRoot":"","sources":["../../src/typescript-language-options.js"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,wCADW,OAAO,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAS/D"}
@@ -1,14 +0,0 @@
1
- // @ts-check
2
-
3
- import tseslint from 'typescript-eslint'
4
-
5
- /** @type {import('eslint').Linter.FlatConfig['languageOptions']} */
6
- export const typescriptLanguageOptions = {
7
- // @ts-expect-error: conflict type
8
- parser: tseslint.parser,
9
- parserOptions: {
10
- project: true,
11
- sourceType: 'module',
12
- ecmaVersion: 'latest',
13
- },
14
- }