@ocavue/eslint-config 2.11.3 → 2.12.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.
@@ -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,qGAyDC"}
@@ -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.3",
5
- "packageManager": "pnpm@9.15.1",
4
+ "version": "2.12.1",
5
+ "packageManager": "pnpm@9.15.2",
6
6
  "description": "",
7
7
  "author": "ocavue <ocavue@gmail.com>",
8
8
  "license": "MIT",
@@ -25,9 +25,9 @@
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": {
@@ -39,21 +39,20 @@
39
39
  "eslint-import-resolver-typescript": "^3.7.0",
40
40
  "eslint-plugin-antfu": "^2.7.0",
41
41
  "eslint-plugin-import-x": "^4.6.1",
42
- "eslint-plugin-jsonc": "^2.18.2",
43
42
  "eslint-plugin-no-only-tests": "^3.3.0",
43
+ "eslint-plugin-package-json": "^0.19.0",
44
44
  "eslint-plugin-react": "^7.37.3",
45
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.18.2"
48
+ "typescript-eslint": "^8.19.0"
50
49
  },
51
50
  "devDependencies": {
52
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.18.2",
55
+ "@typescript-eslint/utils": "^8.19.0",
57
56
  "eslint": "^9.16.0",
58
57
  "prettier": "^3.4.2",
59
58
  "typescript": "^5.7.2"
@@ -1,85 +1,65 @@
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/valid-package-definition': 'off',
14
+ 'package-json/order-properties': [
15
+ 'warn',
16
+ {
17
+ order: [
18
+ 'name',
19
+ 'displayName',
20
+ 'publisher',
21
+ 'type',
22
+ 'version',
23
+ 'private',
24
+ 'packageManager',
25
+ 'description',
26
+ 'author',
27
+ 'license',
28
+ 'funding',
29
+ 'homepage',
30
+ 'repository',
31
+ 'bugs',
32
+ 'contributes',
33
+ 'keywords',
34
+ 'categories',
35
+ 'sideEffects',
36
+ 'main',
37
+ 'module',
38
+ 'types',
39
+ 'exports',
40
+ 'typesVersions',
41
+ 'bin',
42
+ 'icon',
43
+ 'files',
44
+ 'engines',
45
+ 'scripts',
46
+ 'dependencies',
47
+ 'peerDependencies',
48
+ 'peerDependenciesMeta',
49
+ 'optionalDependencies',
50
+ 'devDependencies',
51
+ 'publishConfig',
52
+ 'overrides',
53
+ 'resolutions',
54
+ ],
21
55
  },
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
- },
56
+ ],
81
57
  },
82
- ]
58
+ }
59
+
60
+ /** @type {import('eslint').Linter.Config[]} */
61
+ // @ts-expect-error: unmatched types
62
+ const configs = [config]
83
63
 
84
- return config
64
+ return configs
85
65
  }
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'