@culur/config-eslint 1.0.0 → 1.0.2

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +35 -7
  2. package/README.md +76 -76
  3. package/dist/{chunk-HD3NVFAB.cjs → chunk-4NIL3QOR.cjs} +1 -1
  4. package/dist/chunk-4NIL3QOR.cjs.map +1 -0
  5. package/dist/{chunk-5RDZUQTN.js → chunk-N7KES6RB.js} +1 -1
  6. package/dist/chunk-N7KES6RB.js.map +1 -0
  7. package/dist/{chunk-YILOJM5L.js → chunk-QYDW5TS2.js} +1 -1
  8. package/dist/{chunk-V345HXXJ.cjs.map → chunk-QYDW5TS2.js.map} +1 -1
  9. package/dist/{chunk-V345HXXJ.cjs → chunk-TZB7IM2G.cjs} +1 -1
  10. package/dist/{chunk-YILOJM5L.js.map → chunk-TZB7IM2G.cjs.map} +1 -1
  11. package/dist/{chunk-AZUQMYBV.js → chunk-WJDZNLOH.js} +1 -1
  12. package/dist/chunk-WJDZNLOH.js.map +1 -0
  13. package/dist/{chunk-EWC6UCP7.cjs → chunk-ZIJ5OQW5.cjs} +1 -1
  14. package/dist/chunk-ZIJ5OQW5.cjs.map +1 -0
  15. package/dist/index.cjs +5 -5
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.js +3 -3
  18. package/dist/index.js.map +1 -1
  19. package/dist/overrides/sort-package-json.cjs +2 -2
  20. package/dist/overrides/sort-package-json.js +1 -1
  21. package/dist/overrides/types.cjs +2 -2
  22. package/dist/overrides/types.js +1 -1
  23. package/dist/rules/unicorn-filename-case.cjs +2 -2
  24. package/dist/rules/unicorn-filename-case.js +1 -1
  25. package/package.json +9 -9
  26. package/src/index.test.ts +10 -10
  27. package/src/index.ts +19 -19
  28. package/src/overrides/sort-package-json.test.ts +25 -25
  29. package/src/overrides/sort-package-json.ts +92 -92
  30. package/src/overrides/types.test.ts +25 -25
  31. package/src/overrides/types.ts +9 -9
  32. package/src/rules/unicorn-filename-case.test.ts +7 -7
  33. package/src/rules/unicorn-filename-case.ts +14 -14
  34. package/dist/chunk-5RDZUQTN.js.map +0 -1
  35. package/dist/chunk-AZUQMYBV.js.map +0 -1
  36. package/dist/chunk-EWC6UCP7.cjs.map +0 -1
  37. package/dist/chunk-HD3NVFAB.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,7 +1,35 @@
1
- # @culur/config-eslint
2
-
3
- ## 1.0.0
4
-
5
- ### Major Changes
6
-
7
- - [`210d07d`](https://github.com/culur/culur/commit/210d07d7ca6046807a2ff18011635c3b280dd707) Thanks [@phamhongphuc](https://github.com/phamhongphuc)! - First release
1
+ # @culur/config-eslint
2
+
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#26](https://github.com/culur/culur/pull/26) [`29627d9`](https://github.com/culur/culur/commit/29627d9f3d8966a6010e89fb79c61efd9aa3ba69) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies:
8
+
9
+ - `dependencies`:
10
+ - `@antfu/eslint-config` to `^2.21.1`
11
+ - `devDependencies`:
12
+ - `eslint` to `^9.5.0`
13
+ - `type-fest` to `^4.20.1`
14
+
15
+ ## 1.0.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [`74dbf2c`](https://github.com/culur/culur/commit/74dbf2c0050b30e9289aa7879c4cbb9ac103f4d3) Thanks [@renovate[bot]](https://github.com/renovate%5Bbot%5D)! - Update dependencies from renovate:
20
+
21
+ - `dependencies`:
22
+ - `@antfu/eslint-config` to `^2.20.0`
23
+ - `devDependencies`:
24
+ - `@types/node` to `^20.14.2`
25
+ - `eslint` to `^9.4.0`
26
+ - `tsup` to `^8.1.0`
27
+ - `type-fest` to `^4.19.0`
28
+
29
+ - [`7f4eeae`](https://github.com/culur/culur/commit/7f4eeae4fa2c2dbed218675e8ce2cc91ca0bc4c3) Thanks [@phamhongphuc](https://github.com/phamhongphuc)! - Update workspace dependencies to specific version
30
+
31
+ ## 1.0.0
32
+
33
+ ### Major Changes
34
+
35
+ - [`210d07d`](https://github.com/culur/culur/commit/210d07d7ca6046807a2ff18011635c3b280dd707) Thanks [@phamhongphuc](https://github.com/phamhongphuc)! - First release
package/README.md CHANGED
@@ -1,76 +1,76 @@
1
- # `@culur/config-eslint`
2
-
3
- [![NPM Version](https://img.shields.io/npm/v/@culur/config-eslint?logo=npm)](https://www.npmjs.com/package/@culur/config-eslint)
4
- [![NPM Download](https://img.shields.io/npm/dm/@culur/config-eslint?logo=npm)](https://www.npmjs.com/package/@culur/config-eslint)
5
- [![NPM License](https://img.shields.io/npm/l/@culur/config-eslint)](../../LICENSE)
6
-
7
- [![CodeFactor](https://www.codefactor.io/repository/github/culur/culur/badge)](https://www.codefactor.io/repository/github/culur/culur)
8
- [![Codecov](https://img.shields.io/codecov/c/github/culur/culur)](https://app.codecov.io/gh/culur/culur)
9
- [![Build and release](https://github.com/culur/culur/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/culur/culur/actions/workflows/build-and-release.yml)
10
-
11
- > Sharing [Eslint](https://eslint.org/) configurations.
12
-
13
- ## 💿 Installation
14
-
15
- Add `@culur/config-eslint` dependency to your project.
16
-
17
- ```bash
18
- # Using npm
19
- npm install @culur/config-eslint --save-dev
20
-
21
- # Using yarn
22
- yarn add @culur/config-eslint --dev
23
- ```
24
-
25
- Other packages:
26
-
27
- - Use need to install `eslint` package in devDependencies.
28
- - For `inspector`, you can install `eslint-config-inspector` in devDependencies.
29
-
30
- ## 📖 Usage
31
-
32
- In `eslint.config.js`, use `defineConfig`:
33
-
34
- ```js
35
- // .eslint.config.cjs
36
- const defineConfig = require('@culur/config-eslint');
37
-
38
- module.exports = defineConfig();
39
- ```
40
-
41
- ```js
42
- // .eslint.config.mjs
43
- import defineConfig from '@culur/config-eslint';
44
-
45
- export default defineConfig();
46
- ```
47
-
48
- ## 📜 Scripts
49
-
50
- Some commonly used scripts in `package.json`.
51
-
52
- ```json
53
- {
54
- "scripts": {
55
- "fix:es": "eslint --fix",
56
- "lint:es": "eslint",
57
- "lint:es-in": "eslint-config-inspector"
58
- }
59
- }
60
- ```
61
-
62
- ## ✨ Features
63
-
64
- The library is a shareable Eslint configuration. It has some key features as follows:
65
-
66
- - Extends all config from [`@antfu/eslint-config`](https://github.com/antfu/eslint-config).
67
- - Override and add some rules according to personal opinion.
68
- - Full customizable (use the same functions as `@antfu/eslint-config`).
69
-
70
- ## 🗃️ Changelog
71
-
72
- See [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
73
-
74
- ## 🔒 License
75
-
76
- See [LICENSE](../../LICENSE) for license rights and limitations (MIT).
1
+ # `@culur/config-eslint`
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/@culur/config-eslint?logo=npm)](https://www.npmjs.com/package/@culur/config-eslint)
4
+ [![NPM Download](https://img.shields.io/npm/dm/@culur/config-eslint?logo=npm)](https://www.npmjs.com/package/@culur/config-eslint)
5
+ [![NPM License](https://img.shields.io/npm/l/@culur/config-eslint)](../../LICENSE)
6
+
7
+ [![CodeFactor](https://www.codefactor.io/repository/github/culur/culur/badge)](https://www.codefactor.io/repository/github/culur/culur)
8
+ [![Codecov](https://img.shields.io/codecov/c/github/culur/culur)](https://app.codecov.io/gh/culur/culur)
9
+ [![Build and release](https://github.com/culur/culur/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/culur/culur/actions/workflows/build-and-release.yml)
10
+
11
+ > Sharing [Eslint](https://eslint.org/) configurations.
12
+
13
+ ## 💿 Installation
14
+
15
+ Add `@culur/config-eslint` dependency to your project.
16
+
17
+ ```bash
18
+ # Using npm
19
+ npm install @culur/config-eslint --save-dev
20
+
21
+ # Using yarn
22
+ yarn add @culur/config-eslint --dev
23
+ ```
24
+
25
+ Other packages:
26
+
27
+ - Use need to install `eslint` package in devDependencies.
28
+ - For `inspector`, you can install `eslint-config-inspector` in devDependencies.
29
+
30
+ ## 📖 Usage
31
+
32
+ In `eslint.config.js`, use `defineConfig`:
33
+
34
+ ```js
35
+ // .eslint.config.cjs
36
+ const defineConfig = require('@culur/config-eslint');
37
+
38
+ module.exports = defineConfig();
39
+ ```
40
+
41
+ ```js
42
+ // .eslint.config.mjs
43
+ import defineConfig from '@culur/config-eslint';
44
+
45
+ export default defineConfig();
46
+ ```
47
+
48
+ ## 📜 Scripts
49
+
50
+ Some commonly used scripts in `package.json`.
51
+
52
+ ```json
53
+ {
54
+ "scripts": {
55
+ "fix:es": "eslint --fix",
56
+ "lint:es": "eslint",
57
+ "lint:es-in": "eslint-config-inspector"
58
+ }
59
+ }
60
+ ```
61
+
62
+ ## ✨ Features
63
+
64
+ The library is a shareable Eslint configuration. It has some key features as follows:
65
+
66
+ - Extends all config from [`@antfu/eslint-config`](https://github.com/antfu/eslint-config).
67
+ - Override and add some rules according to personal opinion.
68
+ - Full customizable (use the same functions as `@antfu/eslint-config`).
69
+
70
+ ## 🗃️ Changelog
71
+
72
+ See [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
73
+
74
+ ## 🔒 License
75
+
76
+ See [LICENSE](../../LICENSE) for license rights and limitations (MIT).
@@ -5,4 +5,4 @@ var defineOverride = ({ name, config }) => [name, config];
5
5
 
6
6
  exports.defineOverride = defineOverride;
7
7
  //# sourceMappingURL=out.js.map
8
- //# sourceMappingURL=chunk-HD3NVFAB.cjs.map
8
+ //# sourceMappingURL=chunk-4NIL3QOR.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overrides/types.ts"],"names":[],"mappings":";AAOO,IAAM,iBAAiB,CAAC,EAAE,MAAM,OAAO,MAC5C,CAAC,MAAM,MAAM","sourcesContent":["import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport interface OverrideConfig {\n name: NonNullable<TypedFlatConfigItem['name']>;\n config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);\n}\n\nexport const defineOverride = ({ name, config }: OverrideConfig) =>\n [name, config] as const;\n"]}
@@ -80,4 +80,4 @@ var sortPackageJson = {
80
80
 
81
81
  export { sortPackageJson };
82
82
  //# sourceMappingURL=out.js.map
83
- //# sourceMappingURL=chunk-5RDZUQTN.js.map
83
+ //# sourceMappingURL=chunk-N7KES6RB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overrides/sort-package-json.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB,4BAA4B;AAGjD,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,SAAS;AACb,UAAM,CAAC,UAAU,IAAI,MAAM,qBAAqB;AAChD,WAAO,OAAO,WAAW,SAAS,QAAQ;AAC1C,WAAO,OAAO,WAAW,UAAU,QAAQ;AAE3C,UAAM,WAAW,WAAW,MAAM,iBAAiB;AACnD,WAAO,OAAO,aAAa,QAAQ;AAEnC,UAAM,CAAC,EAAE,OAAO,IAAI;AACpB,WAAO,OAAO,YAAY,QAAQ;AAElC,YAAQ,QAAQ;AAAA;AAAA,MAEd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF","sourcesContent":["import assert from 'node:assert';\nimport { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';\nimport type { OverrideConfig } from './types';\n\nexport const sortPackageJson: OverrideConfig = {\n name: 'antfu/sort/package-json',\n async config() {\n const [configItem] = await sortPackageJsonAntfu();\n assert(typeof configItem.name === 'string');\n assert(typeof configItem.rules === 'object');\n\n const sortKeys = configItem.rules['jsonc/sort-keys'];\n assert(typeof sortKeys === 'object');\n\n const [, options] = sortKeys;\n assert(typeof options === 'object');\n\n options.order = [\n //? Project\n 'publisher',\n 'name',\n 'displayName',\n 'version',\n 'description',\n 'private',\n 'publishConfig',\n\n //? Repository\n 'repository',\n 'bugs',\n 'homepage',\n 'funding',\n\n //? Author & license\n 'contributors',\n 'author',\n 'license',\n\n //? https://code.visualstudio.com/api/references/extension-manifest\n 'keywords',\n 'categories',\n\n //? CDN\n 'unpkg',\n 'jsdelivr',\n\n //? Export\n 'type', // module or commonjs\n 'main',\n 'types',\n 'typings', // synonymous with types\n 'typesVersions',\n 'exports',\n 'bin',\n 'files',\n 'workspaces',\n\n //? https://code.visualstudio.com/api/references/extension-manifest\n 'icon',\n 'activationEvents',\n 'contributes',\n\n //? Scripts\n 'scripts',\n\n //? Node & packageManager\n 'volta',\n 'engines',\n 'packageManager',\n\n //? Dependencies\n 'dependencies',\n 'devDependencies',\n 'peerDependencies',\n 'peerDependenciesMeta',\n 'bundleDependencies',\n 'optionalDependencies',\n\n 'pnpm',\n 'overrides',\n 'resolutions',\n\n //? Lib config\n 'husky',\n 'simple-git-hooks',\n 'lint-staged',\n 'eslintConfig',\n ];\n\n return configItem;\n },\n};\n"]}
@@ -14,4 +14,4 @@ var unicornFilenameCase = {
14
14
 
15
15
  export { unicornFilenameCase };
16
16
  //# sourceMappingURL=out.js.map
17
- //# sourceMappingURL=chunk-YILOJM5L.js.map
17
+ //# sourceMappingURL=chunk-QYDW5TS2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rules/unicorn-filename-case.ts"],"names":[],"mappings":";AAEO,IAAM,sBAA2C;AAAA,EACtD,OAAO,CAAC,WAAW,SAAS;AAAA,EAC5B,OAAO;AAAA,IACL,yBAAyB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,QAAQ,CAAC,WAAW;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\r\n\r\nexport const unicornFilenameCase: TypedFlatConfigItem = {\r\n files: ['**/*.ts', '**/*.js'],\r\n rules: {\r\n 'unicorn/filename-case': [\r\n 'error',\r\n {\r\n case: 'kebabCase',\r\n ignore: ['README.md'],\r\n },\r\n ],\r\n },\r\n};\r\n"]}
1
+ {"version":3,"sources":["../src/rules/unicorn-filename-case.ts"],"names":[],"mappings":";AAEO,IAAM,sBAA2C;AAAA,EACtD,OAAO,CAAC,WAAW,SAAS;AAAA,EAC5B,OAAO;AAAA,IACL,yBAAyB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,QAAQ,CAAC,WAAW;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport const unicornFilenameCase: TypedFlatConfigItem = {\n files: ['**/*.ts', '**/*.js'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: ['README.md'],\n },\n ],\n },\n};\n"]}
@@ -16,4 +16,4 @@ var unicornFilenameCase = {
16
16
 
17
17
  exports.unicornFilenameCase = unicornFilenameCase;
18
18
  //# sourceMappingURL=out.js.map
19
- //# sourceMappingURL=chunk-V345HXXJ.cjs.map
19
+ //# sourceMappingURL=chunk-TZB7IM2G.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rules/unicorn-filename-case.ts"],"names":[],"mappings":";AAEO,IAAM,sBAA2C;AAAA,EACtD,OAAO,CAAC,WAAW,SAAS;AAAA,EAC5B,OAAO;AAAA,IACL,yBAAyB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,QAAQ,CAAC,WAAW;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\r\n\r\nexport const unicornFilenameCase: TypedFlatConfigItem = {\r\n files: ['**/*.ts', '**/*.js'],\r\n rules: {\r\n 'unicorn/filename-case': [\r\n 'error',\r\n {\r\n case: 'kebabCase',\r\n ignore: ['README.md'],\r\n },\r\n ],\r\n },\r\n};\r\n"]}
1
+ {"version":3,"sources":["../src/rules/unicorn-filename-case.ts"],"names":[],"mappings":";AAEO,IAAM,sBAA2C;AAAA,EACtD,OAAO,CAAC,WAAW,SAAS;AAAA,EAC5B,OAAO;AAAA,IACL,yBAAyB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,QAAQ,CAAC,WAAW;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport const unicornFilenameCase: TypedFlatConfigItem = {\n files: ['**/*.ts', '**/*.js'],\n rules: {\n 'unicorn/filename-case': [\n 'error',\n {\n case: 'kebabCase',\n ignore: ['README.md'],\n },\n ],\n },\n};\n"]}
@@ -3,4 +3,4 @@ var defineOverride = ({ name, config }) => [name, config];
3
3
 
4
4
  export { defineOverride };
5
5
  //# sourceMappingURL=out.js.map
6
- //# sourceMappingURL=chunk-AZUQMYBV.js.map
6
+ //# sourceMappingURL=chunk-WJDZNLOH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overrides/types.ts"],"names":[],"mappings":";AAOO,IAAM,iBAAiB,CAAC,EAAE,MAAM,OAAO,MAC5C,CAAC,MAAM,MAAM","sourcesContent":["import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport interface OverrideConfig {\n name: NonNullable<TypedFlatConfigItem['name']>;\n config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);\n}\n\nexport const defineOverride = ({ name, config }: OverrideConfig) =>\n [name, config] as const;\n"]}
@@ -86,4 +86,4 @@ var sortPackageJson = {
86
86
 
87
87
  exports.sortPackageJson = sortPackageJson;
88
88
  //# sourceMappingURL=out.js.map
89
- //# sourceMappingURL=chunk-EWC6UCP7.cjs.map
89
+ //# sourceMappingURL=chunk-ZIJ5OQW5.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/overrides/sort-package-json.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB,4BAA4B;AAGjD,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,SAAS;AACb,UAAM,CAAC,UAAU,IAAI,MAAM,qBAAqB;AAChD,WAAO,OAAO,WAAW,SAAS,QAAQ;AAC1C,WAAO,OAAO,WAAW,UAAU,QAAQ;AAE3C,UAAM,WAAW,WAAW,MAAM,iBAAiB;AACnD,WAAO,OAAO,aAAa,QAAQ;AAEnC,UAAM,CAAC,EAAE,OAAO,IAAI;AACpB,WAAO,OAAO,YAAY,QAAQ;AAElC,YAAQ,QAAQ;AAAA;AAAA,MAEd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF","sourcesContent":["import assert from 'node:assert';\nimport { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';\nimport type { OverrideConfig } from './types';\n\nexport const sortPackageJson: OverrideConfig = {\n name: 'antfu/sort/package-json',\n async config() {\n const [configItem] = await sortPackageJsonAntfu();\n assert(typeof configItem.name === 'string');\n assert(typeof configItem.rules === 'object');\n\n const sortKeys = configItem.rules['jsonc/sort-keys'];\n assert(typeof sortKeys === 'object');\n\n const [, options] = sortKeys;\n assert(typeof options === 'object');\n\n options.order = [\n //? Project\n 'publisher',\n 'name',\n 'displayName',\n 'version',\n 'description',\n 'private',\n 'publishConfig',\n\n //? Repository\n 'repository',\n 'bugs',\n 'homepage',\n 'funding',\n\n //? Author & license\n 'contributors',\n 'author',\n 'license',\n\n //? https://code.visualstudio.com/api/references/extension-manifest\n 'keywords',\n 'categories',\n\n //? CDN\n 'unpkg',\n 'jsdelivr',\n\n //? Export\n 'type', // module or commonjs\n 'main',\n 'types',\n 'typings', // synonymous with types\n 'typesVersions',\n 'exports',\n 'bin',\n 'files',\n 'workspaces',\n\n //? https://code.visualstudio.com/api/references/extension-manifest\n 'icon',\n 'activationEvents',\n 'contributes',\n\n //? Scripts\n 'scripts',\n\n //? Node & packageManager\n 'volta',\n 'engines',\n 'packageManager',\n\n //? Dependencies\n 'dependencies',\n 'devDependencies',\n 'peerDependencies',\n 'peerDependenciesMeta',\n 'bundleDependencies',\n 'optionalDependencies',\n\n 'pnpm',\n 'overrides',\n 'resolutions',\n\n //? Lib config\n 'husky',\n 'simple-git-hooks',\n 'lint-staged',\n 'eslintConfig',\n ];\n\n return configItem;\n },\n};\n"]}
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkEWC6UCP7_cjs = require('./chunk-EWC6UCP7.cjs');
4
- var chunkHD3NVFAB_cjs = require('./chunk-HD3NVFAB.cjs');
5
- var chunkV345HXXJ_cjs = require('./chunk-V345HXXJ.cjs');
3
+ var chunkZIJ5OQW5_cjs = require('./chunk-ZIJ5OQW5.cjs');
4
+ var chunk4NIL3QOR_cjs = require('./chunk-4NIL3QOR.cjs');
5
+ var chunkTZB7IM2G_cjs = require('./chunk-TZB7IM2G.cjs');
6
6
  var antfu = require('@antfu/eslint-config');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -17,9 +17,9 @@ function defineConfig(...[options = {}, ...userConfigs]) {
17
17
  formatters: false,
18
18
  ...options
19
19
  },
20
- chunkV345HXXJ_cjs.unicornFilenameCase,
20
+ chunkTZB7IM2G_cjs.unicornFilenameCase,
21
21
  ...userConfigs
22
- ).override(...chunkHD3NVFAB_cjs.defineOverride(chunkEWC6UCP7_cjs.sortPackageJson));
22
+ ).override(...chunk4NIL3QOR_cjs.defineOverride(chunkZIJ5OQW5_cjs.sortPackageJson));
23
23
  }
24
24
 
25
25
  module.exports = defineConfig;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;AAKH,SAAR,gBACF,CAAC,UAAU,CAAC,GAAG,GAAG,WAAW,GAChC;AACA,SAAO;AAAA,IACL;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,EAAE,SAAS,GAAG,eAAe,eAAe,CAAC;AAC/C","sourcesContent":["import antfu from '@antfu/eslint-config';\r\nimport { sortPackageJson } from './overrides/sort-package-json';\r\nimport { unicornFilenameCase } from './rules/unicorn-filename-case';\r\nimport { defineOverride } from './overrides/types';\r\n\r\nexport default function defineConfig(\r\n ...[options = {}, ...userConfigs]: Parameters<typeof antfu>\r\n) {\r\n return antfu(\r\n {\r\n isInEditor: false,\r\n stylistic: false,\r\n formatters: false,\r\n ...options,\r\n },\r\n unicornFilenameCase,\r\n ...userConfigs,\r\n ).override(...defineOverride(sortPackageJson));\r\n}\r\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;AAKH,SAAR,gBACF,CAAC,UAAU,CAAC,GAAG,GAAG,WAAW,GAChC;AACA,SAAO;AAAA,IACL;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,EAAE,SAAS,GAAG,eAAe,eAAe,CAAC;AAC/C","sourcesContent":["import antfu from '@antfu/eslint-config';\nimport { sortPackageJson } from './overrides/sort-package-json';\nimport { unicornFilenameCase } from './rules/unicorn-filename-case';\nimport { defineOverride } from './overrides/types';\n\nexport default function defineConfig(\n ...[options = {}, ...userConfigs]: Parameters<typeof antfu>\n) {\n return antfu(\n {\n isInEditor: false,\n stylistic: false,\n formatters: false,\n ...options,\n },\n unicornFilenameCase,\n ...userConfigs,\n ).override(...defineOverride(sortPackageJson));\n}\n"]}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { sortPackageJson } from './chunk-5RDZUQTN.js';
2
- import { defineOverride } from './chunk-AZUQMYBV.js';
3
- import { unicornFilenameCase } from './chunk-YILOJM5L.js';
1
+ import { sortPackageJson } from './chunk-N7KES6RB.js';
2
+ import { defineOverride } from './chunk-WJDZNLOH.js';
3
+ import { unicornFilenameCase } from './chunk-QYDW5TS2.js';
4
4
  import antfu from '@antfu/eslint-config';
5
5
 
6
6
  function defineConfig(...[options = {}, ...userConfigs]) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;AAKH,SAAR,gBACF,CAAC,UAAU,CAAC,GAAG,GAAG,WAAW,GAChC;AACA,SAAO;AAAA,IACL;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,EAAE,SAAS,GAAG,eAAe,eAAe,CAAC;AAC/C","sourcesContent":["import antfu from '@antfu/eslint-config';\r\nimport { sortPackageJson } from './overrides/sort-package-json';\r\nimport { unicornFilenameCase } from './rules/unicorn-filename-case';\r\nimport { defineOverride } from './overrides/types';\r\n\r\nexport default function defineConfig(\r\n ...[options = {}, ...userConfigs]: Parameters<typeof antfu>\r\n) {\r\n return antfu(\r\n {\r\n isInEditor: false,\r\n stylistic: false,\r\n formatters: false,\r\n ...options,\r\n },\r\n unicornFilenameCase,\r\n ...userConfigs,\r\n ).override(...defineOverride(sortPackageJson));\r\n}\r\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;AAKH,SAAR,gBACF,CAAC,UAAU,CAAC,GAAG,GAAG,WAAW,GAChC;AACA,SAAO;AAAA,IACL;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,EAAE,SAAS,GAAG,eAAe,eAAe,CAAC;AAC/C","sourcesContent":["import antfu from '@antfu/eslint-config';\nimport { sortPackageJson } from './overrides/sort-package-json';\nimport { unicornFilenameCase } from './rules/unicorn-filename-case';\nimport { defineOverride } from './overrides/types';\n\nexport default function defineConfig(\n ...[options = {}, ...userConfigs]: Parameters<typeof antfu>\n) {\n return antfu(\n {\n isInEditor: false,\n stylistic: false,\n formatters: false,\n ...options,\n },\n unicornFilenameCase,\n ...userConfigs,\n ).override(...defineOverride(sortPackageJson));\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkEWC6UCP7_cjs = require('../chunk-EWC6UCP7.cjs');
3
+ var chunkZIJ5OQW5_cjs = require('../chunk-ZIJ5OQW5.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "sortPackageJson", {
8
8
  enumerable: true,
9
- get: function () { return chunkEWC6UCP7_cjs.sortPackageJson; }
9
+ get: function () { return chunkZIJ5OQW5_cjs.sortPackageJson; }
10
10
  });
11
11
  //# sourceMappingURL=out.js.map
12
12
  //# sourceMappingURL=sort-package-json.cjs.map
@@ -1,3 +1,3 @@
1
- export { sortPackageJson } from '../chunk-5RDZUQTN.js';
1
+ export { sortPackageJson } from '../chunk-N7KES6RB.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=sort-package-json.js.map
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkHD3NVFAB_cjs = require('../chunk-HD3NVFAB.cjs');
3
+ var chunk4NIL3QOR_cjs = require('../chunk-4NIL3QOR.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "defineOverride", {
8
8
  enumerable: true,
9
- get: function () { return chunkHD3NVFAB_cjs.defineOverride; }
9
+ get: function () { return chunk4NIL3QOR_cjs.defineOverride; }
10
10
  });
11
11
  //# sourceMappingURL=out.js.map
12
12
  //# sourceMappingURL=types.cjs.map
@@ -1,3 +1,3 @@
1
- export { defineOverride } from '../chunk-AZUQMYBV.js';
1
+ export { defineOverride } from '../chunk-WJDZNLOH.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=types.js.map
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkV345HXXJ_cjs = require('../chunk-V345HXXJ.cjs');
3
+ var chunkTZB7IM2G_cjs = require('../chunk-TZB7IM2G.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "unicornFilenameCase", {
8
8
  enumerable: true,
9
- get: function () { return chunkV345HXXJ_cjs.unicornFilenameCase; }
9
+ get: function () { return chunkTZB7IM2G_cjs.unicornFilenameCase; }
10
10
  });
11
11
  //# sourceMappingURL=out.js.map
12
12
  //# sourceMappingURL=unicorn-filename-case.cjs.map
@@ -1,3 +1,3 @@
1
- export { unicornFilenameCase } from '../chunk-YILOJM5L.js';
1
+ export { unicornFilenameCase } from '../chunk-QYDW5TS2.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=unicorn-filename-case.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@culur/config-eslint",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Culur's eslint configuration",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -57,21 +57,21 @@
57
57
  "node": ">=20"
58
58
  },
59
59
  "dependencies": {
60
- "@antfu/eslint-config": "^2.18.1"
60
+ "@antfu/eslint-config": "^2.21.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@culur/config-tsup": "*",
64
- "@culur/config-typescript": "*",
65
- "@culur/config-vite": "*",
63
+ "@culur/config-tsup": "1.0.1",
64
+ "@culur/config-typescript": "1.0.1",
65
+ "@culur/config-vite": "1.0.2",
66
66
  "@eslint/eslintrc": "^3.1.0",
67
67
  "@types/eslint": "^8.56.10",
68
- "@types/node": "^20.12.12",
68
+ "@types/node": "^20.14.2",
69
69
  "@vitest/coverage-v8": "^1.6.0",
70
70
  "@vitest/ui": "^1.6.0",
71
- "eslint": "^9.3.0",
71
+ "eslint": "^9.5.0",
72
72
  "rimraf": "^5.0.7",
73
- "tsup": "^8.0.2",
74
- "type-fest": "^4.18.3",
73
+ "tsup": "^8.1.0",
74
+ "type-fest": "^4.20.1",
75
75
  "typescript": "^5.4.5",
76
76
  "vitest": "^1.6.0"
77
77
  },
package/src/index.test.ts CHANGED
@@ -1,10 +1,10 @@
1
- import type antfu from '@antfu/eslint-config';
2
- import { expectTypeOf, it } from 'vitest';
3
- import defineConfig from '.';
4
-
5
- it('should be valid', () => {
6
- const config = defineConfig();
7
-
8
- expectTypeOf(config).toEqualTypeOf<ReturnType<typeof antfu>>();
9
- expectTypeOf(defineConfig).toEqualTypeOf<typeof antfu>();
10
- });
1
+ import type antfu from '@antfu/eslint-config';
2
+ import { expectTypeOf, it } from 'vitest';
3
+ import defineConfig from '.';
4
+
5
+ it('should be valid', () => {
6
+ const config = defineConfig();
7
+
8
+ expectTypeOf(config).toEqualTypeOf<ReturnType<typeof antfu>>();
9
+ expectTypeOf(defineConfig).toEqualTypeOf<typeof antfu>();
10
+ });
package/src/index.ts CHANGED
@@ -1,19 +1,19 @@
1
- import antfu from '@antfu/eslint-config';
2
- import { sortPackageJson } from './overrides/sort-package-json';
3
- import { unicornFilenameCase } from './rules/unicorn-filename-case';
4
- import { defineOverride } from './overrides/types';
5
-
6
- export default function defineConfig(
7
- ...[options = {}, ...userConfigs]: Parameters<typeof antfu>
8
- ) {
9
- return antfu(
10
- {
11
- isInEditor: false,
12
- stylistic: false,
13
- formatters: false,
14
- ...options,
15
- },
16
- unicornFilenameCase,
17
- ...userConfigs,
18
- ).override(...defineOverride(sortPackageJson));
19
- }
1
+ import antfu from '@antfu/eslint-config';
2
+ import { sortPackageJson } from './overrides/sort-package-json';
3
+ import { unicornFilenameCase } from './rules/unicorn-filename-case';
4
+ import { defineOverride } from './overrides/types';
5
+
6
+ export default function defineConfig(
7
+ ...[options = {}, ...userConfigs]: Parameters<typeof antfu>
8
+ ) {
9
+ return antfu(
10
+ {
11
+ isInEditor: false,
12
+ stylistic: false,
13
+ formatters: false,
14
+ ...options,
15
+ },
16
+ unicornFilenameCase,
17
+ ...userConfigs,
18
+ ).override(...defineOverride(sortPackageJson));
19
+ }
@@ -1,25 +1,25 @@
1
- import { sortPackageJson as sortPackageJsonAntfuFunction } from '@antfu/eslint-config';
2
- import { assert, it } from 'vitest';
3
- import { sortPackageJson as sortPackageJsonLocalOverride } from './sort-package-json';
4
-
5
- it('should be valid rule', async () => {
6
- const [sortPackageJsonAntfu] = await sortPackageJsonAntfuFunction();
7
-
8
- const sortPackageJsonLocal =
9
- typeof sortPackageJsonLocalOverride.config === 'function'
10
- ? await sortPackageJsonLocalOverride.config()
11
- : sortPackageJsonLocalOverride.config;
12
-
13
- assert(sortPackageJsonLocal.rules);
14
- assert(sortPackageJsonAntfu.rules);
15
-
16
- assert.deepEqual(
17
- sortPackageJsonLocal.rules['jsonc/sort-array-values'],
18
- sortPackageJsonAntfu.rules['jsonc/sort-array-values'],
19
- );
20
-
21
- assert.containsAllKeys(
22
- sortPackageJsonLocal.rules,
23
- Object.keys(sortPackageJsonAntfu.rules),
24
- );
25
- });
1
+ import { sortPackageJson as sortPackageJsonAntfuFunction } from '@antfu/eslint-config';
2
+ import { assert, it } from 'vitest';
3
+ import { sortPackageJson as sortPackageJsonLocalOverride } from './sort-package-json';
4
+
5
+ it('should be valid rule', async () => {
6
+ const [sortPackageJsonAntfu] = await sortPackageJsonAntfuFunction();
7
+
8
+ const sortPackageJsonLocal =
9
+ typeof sortPackageJsonLocalOverride.config === 'function'
10
+ ? await sortPackageJsonLocalOverride.config()
11
+ : sortPackageJsonLocalOverride.config;
12
+
13
+ assert(sortPackageJsonLocal.rules);
14
+ assert(sortPackageJsonAntfu.rules);
15
+
16
+ assert.deepEqual(
17
+ sortPackageJsonLocal.rules['jsonc/sort-array-values'],
18
+ sortPackageJsonAntfu.rules['jsonc/sort-array-values'],
19
+ );
20
+
21
+ assert.containsAllKeys(
22
+ sortPackageJsonLocal.rules,
23
+ Object.keys(sortPackageJsonAntfu.rules),
24
+ );
25
+ });
@@ -1,92 +1,92 @@
1
- import assert from 'node:assert';
2
- import { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';
3
- import type { OverrideConfig } from './types';
4
-
5
- export const sortPackageJson: OverrideConfig = {
6
- name: 'antfu/sort/package-json',
7
- async config() {
8
- const [configItem] = await sortPackageJsonAntfu();
9
- assert(typeof configItem.name === 'string');
10
- assert(typeof configItem.rules === 'object');
11
-
12
- const sortKeys = configItem.rules['jsonc/sort-keys'];
13
- assert(typeof sortKeys === 'object');
14
-
15
- const [, options] = sortKeys;
16
- assert(typeof options === 'object');
17
-
18
- options.order = [
19
- //? Project
20
- 'publisher',
21
- 'name',
22
- 'displayName',
23
- 'version',
24
- 'description',
25
- 'private',
26
- 'publishConfig',
27
-
28
- //? Repository
29
- 'repository',
30
- 'bugs',
31
- 'homepage',
32
- 'funding',
33
-
34
- //? Author & license
35
- 'contributors',
36
- 'author',
37
- 'license',
38
-
39
- //? https://code.visualstudio.com/api/references/extension-manifest
40
- 'keywords',
41
- 'categories',
42
-
43
- //? CDN
44
- 'unpkg',
45
- 'jsdelivr',
46
-
47
- //? Export
48
- 'type', // module or commonjs
49
- 'main',
50
- 'types',
51
- 'typings', // synonymous with types
52
- 'typesVersions',
53
- 'exports',
54
- 'bin',
55
- 'files',
56
- 'workspaces',
57
-
58
- //? https://code.visualstudio.com/api/references/extension-manifest
59
- 'icon',
60
- 'activationEvents',
61
- 'contributes',
62
-
63
- //? Scripts
64
- 'scripts',
65
-
66
- //? Node & packageManager
67
- 'volta',
68
- 'engines',
69
- 'packageManager',
70
-
71
- //? Dependencies
72
- 'dependencies',
73
- 'devDependencies',
74
- 'peerDependencies',
75
- 'peerDependenciesMeta',
76
- 'bundleDependencies',
77
- 'optionalDependencies',
78
-
79
- 'pnpm',
80
- 'overrides',
81
- 'resolutions',
82
-
83
- //? Lib config
84
- 'husky',
85
- 'simple-git-hooks',
86
- 'lint-staged',
87
- 'eslintConfig',
88
- ];
89
-
90
- return configItem;
91
- },
92
- };
1
+ import assert from 'node:assert';
2
+ import { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';
3
+ import type { OverrideConfig } from './types';
4
+
5
+ export const sortPackageJson: OverrideConfig = {
6
+ name: 'antfu/sort/package-json',
7
+ async config() {
8
+ const [configItem] = await sortPackageJsonAntfu();
9
+ assert(typeof configItem.name === 'string');
10
+ assert(typeof configItem.rules === 'object');
11
+
12
+ const sortKeys = configItem.rules['jsonc/sort-keys'];
13
+ assert(typeof sortKeys === 'object');
14
+
15
+ const [, options] = sortKeys;
16
+ assert(typeof options === 'object');
17
+
18
+ options.order = [
19
+ //? Project
20
+ 'publisher',
21
+ 'name',
22
+ 'displayName',
23
+ 'version',
24
+ 'description',
25
+ 'private',
26
+ 'publishConfig',
27
+
28
+ //? Repository
29
+ 'repository',
30
+ 'bugs',
31
+ 'homepage',
32
+ 'funding',
33
+
34
+ //? Author & license
35
+ 'contributors',
36
+ 'author',
37
+ 'license',
38
+
39
+ //? https://code.visualstudio.com/api/references/extension-manifest
40
+ 'keywords',
41
+ 'categories',
42
+
43
+ //? CDN
44
+ 'unpkg',
45
+ 'jsdelivr',
46
+
47
+ //? Export
48
+ 'type', // module or commonjs
49
+ 'main',
50
+ 'types',
51
+ 'typings', // synonymous with types
52
+ 'typesVersions',
53
+ 'exports',
54
+ 'bin',
55
+ 'files',
56
+ 'workspaces',
57
+
58
+ //? https://code.visualstudio.com/api/references/extension-manifest
59
+ 'icon',
60
+ 'activationEvents',
61
+ 'contributes',
62
+
63
+ //? Scripts
64
+ 'scripts',
65
+
66
+ //? Node & packageManager
67
+ 'volta',
68
+ 'engines',
69
+ 'packageManager',
70
+
71
+ //? Dependencies
72
+ 'dependencies',
73
+ 'devDependencies',
74
+ 'peerDependencies',
75
+ 'peerDependenciesMeta',
76
+ 'bundleDependencies',
77
+ 'optionalDependencies',
78
+
79
+ 'pnpm',
80
+ 'overrides',
81
+ 'resolutions',
82
+
83
+ //? Lib config
84
+ 'husky',
85
+ 'simple-git-hooks',
86
+ 'lint-staged',
87
+ 'eslintConfig',
88
+ ];
89
+
90
+ return configItem;
91
+ },
92
+ };
@@ -1,25 +1,25 @@
1
- import type { Awaitable } from 'vitest';
2
- import { expect, expectTypeOf, it } from 'vitest';
3
- import type { TypedFlatConfigItem } from '@antfu/eslint-config';
4
- import type { OverrideConfig } from './types';
5
- import { defineOverride } from './types';
6
-
7
- it.each<OverrideConfig>([
8
- {
9
- name: 'object',
10
- config: { rules: {} },
11
- },
12
- {
13
- name: 'function',
14
- config: () => ({ rules: {} }),
15
- },
16
- ])('config is $name', options => {
17
- const overrideParameter = defineOverride(options);
18
-
19
- const [name, config] = overrideParameter;
20
-
21
- expect(typeof name).toEqual('string');
22
- expectTypeOf(config).toMatchTypeOf<
23
- TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>)
24
- >();
25
- });
1
+ import type { Awaitable } from 'vitest';
2
+ import { expect, expectTypeOf, it } from 'vitest';
3
+ import type { TypedFlatConfigItem } from '@antfu/eslint-config';
4
+ import type { OverrideConfig } from './types';
5
+ import { defineOverride } from './types';
6
+
7
+ it.each<OverrideConfig>([
8
+ {
9
+ name: 'object',
10
+ config: { rules: {} },
11
+ },
12
+ {
13
+ name: 'function',
14
+ config: () => ({ rules: {} }),
15
+ },
16
+ ])('config is $name', options => {
17
+ const overrideParameter = defineOverride(options);
18
+
19
+ const [name, config] = overrideParameter;
20
+
21
+ expect(typeof name).toEqual('string');
22
+ expectTypeOf(config).toMatchTypeOf<
23
+ TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>)
24
+ >();
25
+ });
@@ -1,9 +1,9 @@
1
- import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';
2
-
3
- export interface OverrideConfig {
4
- name: NonNullable<TypedFlatConfigItem['name']>;
5
- config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);
6
- }
7
-
8
- export const defineOverride = ({ name, config }: OverrideConfig) =>
9
- [name, config] as const;
1
+ import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ export interface OverrideConfig {
4
+ name: NonNullable<TypedFlatConfigItem['name']>;
5
+ config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);
6
+ }
7
+
8
+ export const defineOverride = ({ name, config }: OverrideConfig) =>
9
+ [name, config] as const;
@@ -1,7 +1,7 @@
1
- import { expectTypeOf, it } from 'vitest';
2
- import type { TypedFlatConfigItem } from '@antfu/eslint-config';
3
- import { unicornFilenameCase } from './unicorn-filename-case';
4
-
5
- it('should be valid rule', async () => {
6
- expectTypeOf(unicornFilenameCase).toEqualTypeOf<TypedFlatConfigItem>();
7
- });
1
+ import { expectTypeOf, it } from 'vitest';
2
+ import type { TypedFlatConfigItem } from '@antfu/eslint-config';
3
+ import { unicornFilenameCase } from './unicorn-filename-case';
4
+
5
+ it('should be valid rule', async () => {
6
+ expectTypeOf(unicornFilenameCase).toEqualTypeOf<TypedFlatConfigItem>();
7
+ });
@@ -1,14 +1,14 @@
1
- import type { TypedFlatConfigItem } from '@antfu/eslint-config';
2
-
3
- export const unicornFilenameCase: TypedFlatConfigItem = {
4
- files: ['**/*.ts', '**/*.js'],
5
- rules: {
6
- 'unicorn/filename-case': [
7
- 'error',
8
- {
9
- case: 'kebabCase',
10
- ignore: ['README.md'],
11
- },
12
- ],
13
- },
14
- };
1
+ import type { TypedFlatConfigItem } from '@antfu/eslint-config';
2
+
3
+ export const unicornFilenameCase: TypedFlatConfigItem = {
4
+ files: ['**/*.ts', '**/*.js'],
5
+ rules: {
6
+ 'unicorn/filename-case': [
7
+ 'error',
8
+ {
9
+ case: 'kebabCase',
10
+ ignore: ['README.md'],
11
+ },
12
+ ],
13
+ },
14
+ };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/overrides/sort-package-json.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB,4BAA4B;AAGjD,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,SAAS;AACb,UAAM,CAAC,UAAU,IAAI,MAAM,qBAAqB;AAChD,WAAO,OAAO,WAAW,SAAS,QAAQ;AAC1C,WAAO,OAAO,WAAW,UAAU,QAAQ;AAE3C,UAAM,WAAW,WAAW,MAAM,iBAAiB;AACnD,WAAO,OAAO,aAAa,QAAQ;AAEnC,UAAM,CAAC,EAAE,OAAO,IAAI;AACpB,WAAO,OAAO,YAAY,QAAQ;AAElC,YAAQ,QAAQ;AAAA;AAAA,MAEd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF","sourcesContent":["import assert from 'node:assert';\r\nimport { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';\r\nimport type { OverrideConfig } from './types';\r\n\r\nexport const sortPackageJson: OverrideConfig = {\r\n name: 'antfu/sort/package-json',\r\n async config() {\r\n const [configItem] = await sortPackageJsonAntfu();\r\n assert(typeof configItem.name === 'string');\r\n assert(typeof configItem.rules === 'object');\r\n\r\n const sortKeys = configItem.rules['jsonc/sort-keys'];\r\n assert(typeof sortKeys === 'object');\r\n\r\n const [, options] = sortKeys;\r\n assert(typeof options === 'object');\r\n\r\n options.order = [\r\n //? Project\r\n 'publisher',\r\n 'name',\r\n 'displayName',\r\n 'version',\r\n 'description',\r\n 'private',\r\n 'publishConfig',\r\n\r\n //? Repository\r\n 'repository',\r\n 'bugs',\r\n 'homepage',\r\n 'funding',\r\n\r\n //? Author & license\r\n 'contributors',\r\n 'author',\r\n 'license',\r\n\r\n //? https://code.visualstudio.com/api/references/extension-manifest\r\n 'keywords',\r\n 'categories',\r\n\r\n //? CDN\r\n 'unpkg',\r\n 'jsdelivr',\r\n\r\n //? Export\r\n 'type', // module or commonjs\r\n 'main',\r\n 'types',\r\n 'typings', // synonymous with types\r\n 'typesVersions',\r\n 'exports',\r\n 'bin',\r\n 'files',\r\n 'workspaces',\r\n\r\n //? https://code.visualstudio.com/api/references/extension-manifest\r\n 'icon',\r\n 'activationEvents',\r\n 'contributes',\r\n\r\n //? Scripts\r\n 'scripts',\r\n\r\n //? Node & packageManager\r\n 'volta',\r\n 'engines',\r\n 'packageManager',\r\n\r\n //? Dependencies\r\n 'dependencies',\r\n 'devDependencies',\r\n 'peerDependencies',\r\n 'peerDependenciesMeta',\r\n 'bundleDependencies',\r\n 'optionalDependencies',\r\n\r\n 'pnpm',\r\n 'overrides',\r\n 'resolutions',\r\n\r\n //? Lib config\r\n 'husky',\r\n 'simple-git-hooks',\r\n 'lint-staged',\r\n 'eslintConfig',\r\n ];\r\n\r\n return configItem;\r\n },\r\n};\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/overrides/types.ts"],"names":[],"mappings":";AAOO,IAAM,iBAAiB,CAAC,EAAE,MAAM,OAAO,MAC5C,CAAC,MAAM,MAAM","sourcesContent":["import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';\r\n\r\nexport interface OverrideConfig {\r\n name: NonNullable<TypedFlatConfigItem['name']>;\r\n config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);\r\n}\r\n\r\nexport const defineOverride = ({ name, config }: OverrideConfig) =>\r\n [name, config] as const;\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/overrides/sort-package-json.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB,4BAA4B;AAGjD,IAAM,kBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,SAAS;AACb,UAAM,CAAC,UAAU,IAAI,MAAM,qBAAqB;AAChD,WAAO,OAAO,WAAW,SAAS,QAAQ;AAC1C,WAAO,OAAO,WAAW,UAAU,QAAQ;AAE3C,UAAM,WAAW,WAAW,MAAM,iBAAiB;AACnD,WAAO,OAAO,aAAa,QAAQ;AAEnC,UAAM,CAAC,EAAE,OAAO,IAAI;AACpB,WAAO,OAAO,YAAY,QAAQ;AAElC,YAAQ,QAAQ;AAAA;AAAA,MAEd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAGA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF","sourcesContent":["import assert from 'node:assert';\r\nimport { sortPackageJson as sortPackageJsonAntfu } from '@antfu/eslint-config';\r\nimport type { OverrideConfig } from './types';\r\n\r\nexport const sortPackageJson: OverrideConfig = {\r\n name: 'antfu/sort/package-json',\r\n async config() {\r\n const [configItem] = await sortPackageJsonAntfu();\r\n assert(typeof configItem.name === 'string');\r\n assert(typeof configItem.rules === 'object');\r\n\r\n const sortKeys = configItem.rules['jsonc/sort-keys'];\r\n assert(typeof sortKeys === 'object');\r\n\r\n const [, options] = sortKeys;\r\n assert(typeof options === 'object');\r\n\r\n options.order = [\r\n //? Project\r\n 'publisher',\r\n 'name',\r\n 'displayName',\r\n 'version',\r\n 'description',\r\n 'private',\r\n 'publishConfig',\r\n\r\n //? Repository\r\n 'repository',\r\n 'bugs',\r\n 'homepage',\r\n 'funding',\r\n\r\n //? Author & license\r\n 'contributors',\r\n 'author',\r\n 'license',\r\n\r\n //? https://code.visualstudio.com/api/references/extension-manifest\r\n 'keywords',\r\n 'categories',\r\n\r\n //? CDN\r\n 'unpkg',\r\n 'jsdelivr',\r\n\r\n //? Export\r\n 'type', // module or commonjs\r\n 'main',\r\n 'types',\r\n 'typings', // synonymous with types\r\n 'typesVersions',\r\n 'exports',\r\n 'bin',\r\n 'files',\r\n 'workspaces',\r\n\r\n //? https://code.visualstudio.com/api/references/extension-manifest\r\n 'icon',\r\n 'activationEvents',\r\n 'contributes',\r\n\r\n //? Scripts\r\n 'scripts',\r\n\r\n //? Node & packageManager\r\n 'volta',\r\n 'engines',\r\n 'packageManager',\r\n\r\n //? Dependencies\r\n 'dependencies',\r\n 'devDependencies',\r\n 'peerDependencies',\r\n 'peerDependenciesMeta',\r\n 'bundleDependencies',\r\n 'optionalDependencies',\r\n\r\n 'pnpm',\r\n 'overrides',\r\n 'resolutions',\r\n\r\n //? Lib config\r\n 'husky',\r\n 'simple-git-hooks',\r\n 'lint-staged',\r\n 'eslintConfig',\r\n ];\r\n\r\n return configItem;\r\n },\r\n};\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/overrides/types.ts"],"names":[],"mappings":";AAOO,IAAM,iBAAiB,CAAC,EAAE,MAAM,OAAO,MAC5C,CAAC,MAAM,MAAM","sourcesContent":["import type { Awaitable, TypedFlatConfigItem } from '@antfu/eslint-config';\r\n\r\nexport interface OverrideConfig {\r\n name: NonNullable<TypedFlatConfigItem['name']>;\r\n config: TypedFlatConfigItem | (() => Awaitable<TypedFlatConfigItem>);\r\n}\r\n\r\nexport const defineOverride = ({ name, config }: OverrideConfig) =>\r\n [name, config] as const;\r\n"]}