@ocavue/eslint-config 2.11.2 → 2.12.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":"package-json.d.ts","sourceRoot":"","sources":["../../src/package-json.js"],"names":[],"mappings":"AAOA;;GAEG;AACH,qGA0EC"}
1
+ {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/package-json.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,qGAwDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.js"],"names":[],"mappings":"AAUA,+FAiCC"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/react.js"],"names":[],"mappings":"AAWA,+FAiCC"}
@@ -12,7 +12,6 @@ export const GLOB_SCSS: "**/*.scss";
12
12
  export const GLOB_JSON: "**/*.json";
13
13
  export const GLOB_JSON5: "**/*.json5";
14
14
  export const GLOB_JSONC: "**/*.jsonc";
15
- export const GLOB_PACKAGE_JSON: "**/package.json";
16
15
  export const GLOB_MARKDOWN: "**/*.md";
17
16
  export const GLOB_VUE: "**/*.vue";
18
17
  export const GLOB_YAML: "**/*.y?(a)ml";
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/shared.js"],"names":[],"mappings":"AAEA,2BAA4B,kBAAkB,CAAA;AAC9C,uBAAwB,uBAAuB,CAAA;AAE/C,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,wBAAyB,mCAAmC,CAAA;AAE5D,yBAA0B,kBAAkB,CAAA;AAC5C,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,WAAW,CAAA;AACpC,wBAAyB,WAAW,CAAA;AAEpC,wBAAyB,WAAW,CAAA;AACpC,yBAA0B,YAAY,CAAA;AACtC,yBAA0B,YAAY,CAAA;AAEtC,gCAAiC,iBAAiB,CAAA;AAElD,4BAA6B,SAAS,CAAA;AACtC,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,cAAc,CAAA;AACvC,wBAAyB,cAAc,CAAA;AAEvC,oKASE;AAEF,gCAAuD,iBAAiB,CAAC;AACzE,mGAIE;AACF,sOAWE;AAEF,kCAGsC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/shared.js"],"names":[],"mappings":"AAEA,2BAA4B,kBAAkB,CAAA;AAC9C,uBAAwB,uBAAuB,CAAA;AAE/C,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,sBAAuB,gBAAgB,CAAA;AACvC,uBAAwB,iBAAiB,CAAA;AAEzC,wBAAyB,mCAAmC,CAAA;AAE5D,yBAA0B,kBAAkB,CAAA;AAC5C,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,WAAW,CAAA;AACpC,wBAAyB,WAAW,CAAA;AAEpC,wBAAyB,WAAW,CAAA;AACpC,yBAA0B,YAAY,CAAA;AACtC,yBAA0B,YAAY,CAAA;AAEtC,4BAA6B,SAAS,CAAA;AACtC,uBAAwB,UAAU,CAAA;AAClC,wBAAyB,cAAc,CAAA;AACvC,wBAAyB,cAAc,CAAA;AAEvC,oKASE;AAEF,gCAAuD,iBAAiB,CAAC;AACzE,mGAIE;AACF,sOAWE;AAEF,kCAGsC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ocavue/eslint-config",
3
3
  "type": "module",
4
- "version": "2.11.2",
5
- "packageManager": "pnpm@9.14.4",
4
+ "version": "2.12.0",
5
+ "packageManager": "pnpm@9.15.1",
6
6
  "description": "",
7
7
  "author": "ocavue <ocavue@gmail.com>",
8
8
  "license": "MIT",
@@ -25,37 +25,36 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "build": "tsc",
28
- "lint": "eslint .",
29
28
  "check": "prettier --check .",
30
29
  "fix": "eslint --fix . && prettier --write .",
30
+ "lint": "eslint .",
31
31
  "prepublishOnly": "nr build"
32
32
  },
33
33
  "dependencies": {
34
34
  "@eslint-types/unicorn": "^52.0.0",
35
- "@eslint/js": "^9.16.0",
35
+ "@eslint/js": "^9.17.0",
36
36
  "@eslint/markdown": "^6.2.1",
37
37
  "eslint-config-flat-gitignore": "^0.3.0",
38
38
  "eslint-config-prettier": "^9.1.0",
39
- "eslint-import-resolver-typescript": "^3.6.3",
39
+ "eslint-import-resolver-typescript": "^3.7.0",
40
40
  "eslint-plugin-antfu": "^2.7.0",
41
- "eslint-plugin-import-x": "^4.4.3",
42
- "eslint-plugin-jsonc": "^2.18.2",
41
+ "eslint-plugin-import-x": "^4.6.1",
43
42
  "eslint-plugin-no-only-tests": "^3.3.0",
44
- "eslint-plugin-react": "^7.37.2",
45
- "eslint-plugin-react-hooks": "^5.0.0",
43
+ "eslint-plugin-package-json": "^0.19.0",
44
+ "eslint-plugin-react": "^7.37.3",
45
+ "eslint-plugin-react-hooks": "^5.1.0",
46
46
  "eslint-plugin-unicorn": "^56.0.1",
47
47
  "eslint-plugin-vue": "^9.32.0",
48
- "jsonc-eslint-parser": "^2.4.0",
49
- "typescript-eslint": "^8.16.0"
48
+ "typescript-eslint": "^8.18.2"
50
49
  },
51
50
  "devDependencies": {
52
- "@antfu/ni": "^0.23.1",
51
+ "@antfu/ni": "^0.23.2",
53
52
  "@types/eslint-config-prettier": "^6.11.3",
54
53
  "@types/eslint__js": "^8.42.3",
55
54
  "@types/node": "^20.17.9",
56
- "@typescript-eslint/utils": "^8.16.0",
55
+ "@typescript-eslint/utils": "^8.18.2",
57
56
  "eslint": "^9.16.0",
58
- "prettier": "^3.4.1",
57
+ "prettier": "^3.4.2",
59
58
  "typescript": "^5.7.2"
60
59
  },
61
60
  "renovate": {
@@ -1,85 +1,64 @@
1
1
  // @ts-check
2
2
 
3
- import plugin from 'eslint-plugin-jsonc'
4
- import parser from 'jsonc-eslint-parser'
5
-
6
- import { GLOB_PACKAGE_JSON } from './shared.js'
3
+ import pkgJson from 'eslint-plugin-package-json/configs/recommended'
7
4
 
8
5
  /**
9
6
  * Sort package.json keys
10
7
  */
11
8
  export function packageJson() {
12
- /** @type {import('eslint').Linter.Config[]} */
13
- const config = [
14
- {
15
- name: 'package-json',
16
- files: [GLOB_PACKAGE_JSON],
17
- languageOptions: {
18
- parser,
19
- parserOptions: {
20
- jsonSyntax: 'JSON5',
9
+ const config = {
10
+ ...pkgJson,
11
+ rules: {
12
+ ...pkgJson.rules,
13
+ 'package-json/order-properties': [
14
+ 'warn',
15
+ {
16
+ order: [
17
+ 'name',
18
+ 'displayName',
19
+ 'publisher',
20
+ 'type',
21
+ 'version',
22
+ 'private',
23
+ 'packageManager',
24
+ 'description',
25
+ 'author',
26
+ 'license',
27
+ 'funding',
28
+ 'homepage',
29
+ 'repository',
30
+ 'bugs',
31
+ 'contributes',
32
+ 'keywords',
33
+ 'categories',
34
+ 'sideEffects',
35
+ 'main',
36
+ 'module',
37
+ 'types',
38
+ 'exports',
39
+ 'typesVersions',
40
+ 'bin',
41
+ 'icon',
42
+ 'files',
43
+ 'engines',
44
+ 'scripts',
45
+ 'dependencies',
46
+ 'peerDependencies',
47
+ 'peerDependenciesMeta',
48
+ 'optionalDependencies',
49
+ 'devDependencies',
50
+ 'publishConfig',
51
+ 'overrides',
52
+ 'resolutions',
53
+ ],
21
54
  },
22
- },
23
- plugins: {
24
- // @ts-expect-error: incorrect types
25
- jsonc: plugin,
26
- },
27
- rules: {
28
- 'jsonc/sort-keys': [
29
- 'warn',
30
- {
31
- pathPattern: '^$',
32
- order: [
33
- 'name',
34
- 'displayName',
35
- 'publisher',
36
- 'type',
37
- 'version',
38
- 'private',
39
- 'packageManager',
40
- 'description',
41
- 'author',
42
- 'license',
43
- 'funding',
44
- 'homepage',
45
- 'repository',
46
- 'bugs',
47
- 'contributes',
48
- 'keywords',
49
- 'categories',
50
- 'sideEffects',
51
- 'main',
52
- 'module',
53
- 'types',
54
- 'exports',
55
- 'typesVersions',
56
- 'bin',
57
- 'icon',
58
- 'files',
59
- 'engines',
60
- 'scripts',
61
- 'dependencies',
62
- 'peerDependencies',
63
- 'peerDependenciesMeta',
64
- 'optionalDependencies',
65
- 'devDependencies',
66
- 'publishConfig',
67
- 'overrides',
68
- 'resolutions',
69
- ],
70
- },
71
- {
72
- pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies$',
73
- order: { type: 'asc' },
74
- },
75
- {
76
- pathPattern: '^exports.*$',
77
- order: ['types', 'require', 'import', 'default'],
78
- },
79
- ],
80
- },
55
+ ],
81
56
  },
82
- ]
57
+ }
58
+
59
+ /** @type {import('eslint').Linter.Config[]} */
60
+ // @ts-expect-error: unmatched types
61
+ const configs = [config]
83
62
 
84
- return config
63
+ return configs
85
64
  }
package/src/react.js CHANGED
@@ -1,12 +1,13 @@
1
1
  // @ts-check
2
2
 
3
3
  import reactPlugin from 'eslint-plugin-react'
4
+
4
5
  import reactHooksPlugin from 'eslint-plugin-react-hooks'
5
6
 
6
7
  import { GLOB_TS, GLOB_TSX } from './shared.js'
7
8
 
8
9
  /** @type {import('eslint').Linter.Config} */
9
- const reactRecommended = reactPlugin.configs.flat.recommended
10
+ const reactRecommended = reactPlugin.configs.flat?.recommended || {}
10
11
 
11
12
  export function react() {
12
13
  /** @type {import('eslint').Linter.Config[]} */
package/src/shared.js CHANGED
@@ -20,8 +20,6 @@ export const GLOB_JSON = '**/*.json'
20
20
  export const GLOB_JSON5 = '**/*.json5'
21
21
  export const GLOB_JSONC = '**/*.jsonc'
22
22
 
23
- export const GLOB_PACKAGE_JSON = '**/package.json'
24
-
25
23
  export const GLOB_MARKDOWN = '**/*.md'
26
24
  export const GLOB_VUE = '**/*.vue'
27
25
  export const GLOB_YAML = '**/*.y?(a)ml'