@ivanmaxlogiudice/eslint-config 1.0.31 → 2.0.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.
package/README.md CHANGED
@@ -118,7 +118,7 @@ Add the following settings to your `settings.json`:
118
118
  ```jsonc
119
119
  {
120
120
  // Enable the flat config support
121
- "eslint.experimental.useFlatConfig": true,
121
+ "eslint.useFlatConfig": true,
122
122
 
123
123
  // Disable the default formatter
124
124
  "prettier.enable": false,
@@ -308,6 +308,8 @@ When you want to override rules, or disable them inline, you need to update to t
308
308
  type foo = { bar: 2 }
309
309
  ```
310
310
 
311
+ Since v2.0.0, this preset will automatically rename the plugins also for your custom configs. You can use the original prefix to override the rules directly.
312
+
311
313
  ### Rules Overrides
312
314
 
313
315
  Certain rules would only be enabled in specific files, for example, `ts/*` rules would only be enabled in `.ts` files and `vue/*` rules would only be enabled in `.vue` files. If you want to override the rules, you need to specify the file extension:
@@ -337,7 +339,7 @@ export default config(
337
339
  )
338
340
  ```
339
341
 
340
- We also provided a `overrides` options in each integration to make it easier:
342
+ We also provided the `overrides` options in each integration to make it easier:
341
343
 
342
344
  ```js
343
345
  // eslint.config.js
@@ -362,6 +364,35 @@ export default config({
362
364
  })
363
365
  ```
364
366
 
367
+ ### Config Composer
368
+
369
+ Since v2.0.0, the factory function `config()` returns a [`FlatConfigComposer` object from `eslint-flat-config-utils`](https://github.com/antfu/eslint-flat-config-utils#composer) where you can chain the methods to compose the config even more flexibly.
370
+
371
+ ```js
372
+ // eslint.config.js
373
+ import config from '@ivanmaxlogiudice/eslint-config'
374
+
375
+ export default config()
376
+ .prepend(
377
+ // some configs before the main config
378
+ )
379
+ // overrides any named configs
380
+ .override(
381
+ 'antfu/imports',
382
+ {
383
+ rules: {
384
+ 'import/order': ['error', { 'newlines-between': 'always' }],
385
+ }
386
+ }
387
+ )
388
+ // rename plugin prefixes
389
+ .renamePlugins({
390
+ 'old-prefix': 'new-prefix',
391
+ // ...
392
+ })
393
+ // ...
394
+ ```
395
+
365
396
  ### Optional Configs
366
397
 
367
398
  We provide some optional configs for specific use cases, that we don't include their dependencies by default.
@@ -448,7 +479,6 @@ const objectWantedToSort = {
448
479
  b: 1,
449
480
  c: 3,
450
481
  }
451
- /* eslint perfectionist/sort-objects: "off" */
452
482
  ```
453
483
 
454
484
  ### Type Aware Rules
package/dist/cli.cjs CHANGED
@@ -40,8 +40,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
40
40
  // package.json
41
41
  var package_default = {
42
42
  name: "@ivanmaxlogiudice/eslint-config",
43
- version: "1.0.31",
44
- packageManager: "pnpm@8.15.6",
43
+ version: "2.0.1",
44
+ packageManager: "pnpm@9.0.4",
45
45
  description: "Personal ESLint config",
46
46
  type: "module",
47
47
  keywords: [
@@ -74,10 +74,10 @@ var package_default = {
74
74
  },
75
75
  scripts: {
76
76
  stub: "tsup --format esm",
77
- dev: "tsup --format esm,cjs --watch & pnpx @eslint/config-inspector",
77
+ dev: "pnpx @eslint/config-inspector --config eslint.config.ts",
78
78
  build: "pnpm run typegen && tsup --format esm,cjs --clean --dts",
79
79
  "build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
80
- lint: "pnpm run stub && eslint .",
80
+ lint: "pnpm run stub && eslint . --fix",
81
81
  typegen: "esno scripts/typegen.ts",
82
82
  prepack: "pnpm run build",
83
83
  release: "bumpp && pnpm publish",
@@ -101,29 +101,29 @@ var package_default = {
101
101
  dependencies: {
102
102
  "@antfu/install-pkg": "^0.3.2",
103
103
  "@clack/prompts": "^0.7.0",
104
- "@stylistic/eslint-plugin": "^1.7.0",
105
- "@typescript-eslint/eslint-plugin": "^7.5.0",
106
- "@typescript-eslint/parser": "^7.5.0",
104
+ "@stylistic/eslint-plugin": "^1.7.2",
105
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
106
+ "@typescript-eslint/parser": "^7.7.0",
107
107
  "detect-indent": "^7.0.1",
108
108
  "eslint-config-flat-gitignore": "^0.1.5",
109
+ "eslint-flat-config-utils": "^0.2.3",
109
110
  "eslint-merge-processors": "^0.1.0",
110
111
  "eslint-plugin-antfu": "^2.1.2",
111
112
  "eslint-plugin-eslint-comments": "^3.2.0",
112
113
  "eslint-plugin-import-x": "^0.5.0",
113
- "eslint-plugin-jsdoc": "^48.2.2",
114
- "eslint-plugin-jsonc": "^2.15.0",
114
+ "eslint-plugin-jsdoc": "^48.2.3",
115
+ "eslint-plugin-jsonc": "^2.15.1",
115
116
  "eslint-plugin-markdown": "^4.0.1",
116
- "eslint-plugin-n": "^16.6.2",
117
+ "eslint-plugin-n": "^17.2.1",
117
118
  "eslint-plugin-no-only-tests": "^3.1.0",
118
- "eslint-plugin-perfectionist": "^2.7.0",
119
- "eslint-plugin-promise": "^6.1.1",
120
- "eslint-plugin-unicorn": "^51.0.1",
119
+ "eslint-plugin-perfectionist": "^2.9.0",
120
+ "eslint-plugin-unicorn": "^52.0.0",
121
121
  "eslint-plugin-unused-imports": "^3.1.0",
122
- "eslint-plugin-vitest": "^0.4.1",
123
- "eslint-plugin-vue": "^9.24.0",
122
+ "eslint-plugin-vitest": "^0.5.3",
123
+ "eslint-plugin-vue": "^9.25.0",
124
124
  "eslint-plugin-yml": "^1.14.0",
125
- "eslint-processor-vue-blocks": "^0.1.1",
126
- "eslint-typegen": "^0.2.0",
125
+ "eslint-processor-vue-blocks": "^0.1.2",
126
+ "eslint-typegen": "^0.2.3",
127
127
  globals: "^15.0.0",
128
128
  "jsonc-eslint-parser": "^2.4.0",
129
129
  "local-pkg": "^0.5.0",
@@ -134,17 +134,18 @@ var package_default = {
134
134
  yargs: "^17.7.2"
135
135
  },
136
136
  devDependencies: {
137
- "@eslint/config-inspector": "^0.3.1",
138
- "@stylistic/eslint-plugin-migrate": "^1.7.0",
139
- "@types/eslint": "^8.56.7",
137
+ "@eslint/config-inspector": "^0.4.6",
138
+ "@stylistic/eslint-plugin-migrate": "^1.7.2",
139
+ "@types/eslint": "^8.56.10",
140
140
  "@types/fs-extra": "^11.0.4",
141
- "@types/node": "^20.12.3",
141
+ "@types/node": "^20.12.7",
142
142
  "@types/prompts": "^2.4.9",
143
143
  "@types/yargs": "^17.0.32",
144
- "@unocss/eslint-plugin": "^0.58.9",
144
+ "@unocss/eslint-plugin": "^0.59.4",
145
145
  bumpp: "^9.4.0",
146
- eslint: "^8.57.0",
147
- "eslint-plugin-format": "^0.1.0",
146
+ "bundle-require": "^4.0.2",
147
+ eslint: "^9.1.0",
148
+ "eslint-plugin-format": "^0.1.1",
148
149
  esno: "^4.7.0",
149
150
  execa: "^8.0.1",
150
151
  "fast-glob": "^3.3.2",
@@ -152,9 +153,9 @@ var package_default = {
152
153
  "lint-staged": "^15.2.2",
153
154
  "simple-git-hooks": "^2.11.1",
154
155
  tsup: "^8.0.2",
155
- typescript: "^5.4.3",
156
- vitest: "^1.4.0",
157
- vue: "^3.4.21"
156
+ typescript: "^5.4.5",
157
+ vitest: "^1.5.0",
158
+ vue: "^3.4.23"
158
159
  },
159
160
  engines: {
160
161
  node: ">=18.12.0"
@@ -174,7 +175,7 @@ var CROSS = import_picocolors.default.red("\u2718");
174
175
  var WARN = import_picocolors.default.yellow("\u2139");
175
176
  var vscodeSettingsString = `
176
177
  // Enable the ESlint flat config support
177
- "eslint.experimental.useFlatConfig": true,
178
+ "eslint.useFlatConfig": true,
178
179
 
179
180
  // Disable the default formatter, use eslint instead
180
181
  "prettier.enable": false,
package/dist/cli.js CHANGED
@@ -1,12 +1,4 @@
1
- import {
2
- init_esm_shims
3
- } from "./chunk-AWNEBLNN.js";
4
-
5
- // src/cli.ts
6
- init_esm_shims();
7
-
8
1
  // src/cli/index.ts
9
- init_esm_shims();
10
2
  import process5 from "node:process";
11
3
  import * as p5 from "@clack/prompts";
12
4
  import c6 from "picocolors";
@@ -14,14 +6,13 @@ import yargs from "yargs";
14
6
  import { hideBin } from "yargs/helpers";
15
7
 
16
8
  // src/cli/constants.ts
17
- init_esm_shims();
18
9
  import c from "picocolors";
19
10
 
20
11
  // package.json
21
12
  var package_default = {
22
13
  name: "@ivanmaxlogiudice/eslint-config",
23
- version: "1.0.31",
24
- packageManager: "pnpm@8.15.6",
14
+ version: "2.0.1",
15
+ packageManager: "pnpm@9.0.4",
25
16
  description: "Personal ESLint config",
26
17
  type: "module",
27
18
  keywords: [
@@ -54,10 +45,10 @@ var package_default = {
54
45
  },
55
46
  scripts: {
56
47
  stub: "tsup --format esm",
57
- dev: "tsup --format esm,cjs --watch & pnpx @eslint/config-inspector",
48
+ dev: "pnpx @eslint/config-inspector --config eslint.config.ts",
58
49
  build: "pnpm run typegen && tsup --format esm,cjs --clean --dts",
59
50
  "build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
60
- lint: "pnpm run stub && eslint .",
51
+ lint: "pnpm run stub && eslint . --fix",
61
52
  typegen: "esno scripts/typegen.ts",
62
53
  prepack: "pnpm run build",
63
54
  release: "bumpp && pnpm publish",
@@ -81,29 +72,29 @@ var package_default = {
81
72
  dependencies: {
82
73
  "@antfu/install-pkg": "^0.3.2",
83
74
  "@clack/prompts": "^0.7.0",
84
- "@stylistic/eslint-plugin": "^1.7.0",
85
- "@typescript-eslint/eslint-plugin": "^7.5.0",
86
- "@typescript-eslint/parser": "^7.5.0",
75
+ "@stylistic/eslint-plugin": "^1.7.2",
76
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
77
+ "@typescript-eslint/parser": "^7.7.0",
87
78
  "detect-indent": "^7.0.1",
88
79
  "eslint-config-flat-gitignore": "^0.1.5",
80
+ "eslint-flat-config-utils": "^0.2.3",
89
81
  "eslint-merge-processors": "^0.1.0",
90
82
  "eslint-plugin-antfu": "^2.1.2",
91
83
  "eslint-plugin-eslint-comments": "^3.2.0",
92
84
  "eslint-plugin-import-x": "^0.5.0",
93
- "eslint-plugin-jsdoc": "^48.2.2",
94
- "eslint-plugin-jsonc": "^2.15.0",
85
+ "eslint-plugin-jsdoc": "^48.2.3",
86
+ "eslint-plugin-jsonc": "^2.15.1",
95
87
  "eslint-plugin-markdown": "^4.0.1",
96
- "eslint-plugin-n": "^16.6.2",
88
+ "eslint-plugin-n": "^17.2.1",
97
89
  "eslint-plugin-no-only-tests": "^3.1.0",
98
- "eslint-plugin-perfectionist": "^2.7.0",
99
- "eslint-plugin-promise": "^6.1.1",
100
- "eslint-plugin-unicorn": "^51.0.1",
90
+ "eslint-plugin-perfectionist": "^2.9.0",
91
+ "eslint-plugin-unicorn": "^52.0.0",
101
92
  "eslint-plugin-unused-imports": "^3.1.0",
102
- "eslint-plugin-vitest": "^0.4.1",
103
- "eslint-plugin-vue": "^9.24.0",
93
+ "eslint-plugin-vitest": "^0.5.3",
94
+ "eslint-plugin-vue": "^9.25.0",
104
95
  "eslint-plugin-yml": "^1.14.0",
105
- "eslint-processor-vue-blocks": "^0.1.1",
106
- "eslint-typegen": "^0.2.0",
96
+ "eslint-processor-vue-blocks": "^0.1.2",
97
+ "eslint-typegen": "^0.2.3",
107
98
  globals: "^15.0.0",
108
99
  "jsonc-eslint-parser": "^2.4.0",
109
100
  "local-pkg": "^0.5.0",
@@ -114,17 +105,18 @@ var package_default = {
114
105
  yargs: "^17.7.2"
115
106
  },
116
107
  devDependencies: {
117
- "@eslint/config-inspector": "^0.3.1",
118
- "@stylistic/eslint-plugin-migrate": "^1.7.0",
119
- "@types/eslint": "^8.56.7",
108
+ "@eslint/config-inspector": "^0.4.6",
109
+ "@stylistic/eslint-plugin-migrate": "^1.7.2",
110
+ "@types/eslint": "^8.56.10",
120
111
  "@types/fs-extra": "^11.0.4",
121
- "@types/node": "^20.12.3",
112
+ "@types/node": "^20.12.7",
122
113
  "@types/prompts": "^2.4.9",
123
114
  "@types/yargs": "^17.0.32",
124
- "@unocss/eslint-plugin": "^0.58.9",
115
+ "@unocss/eslint-plugin": "^0.59.4",
125
116
  bumpp: "^9.4.0",
126
- eslint: "^8.57.0",
127
- "eslint-plugin-format": "^0.1.0",
117
+ "bundle-require": "^4.0.2",
118
+ eslint: "^9.1.0",
119
+ "eslint-plugin-format": "^0.1.1",
128
120
  esno: "^4.7.0",
129
121
  execa: "^8.0.1",
130
122
  "fast-glob": "^3.3.2",
@@ -132,9 +124,9 @@ var package_default = {
132
124
  "lint-staged": "^15.2.2",
133
125
  "simple-git-hooks": "^2.11.1",
134
126
  tsup: "^8.0.2",
135
- typescript: "^5.4.3",
136
- vitest: "^1.4.0",
137
- vue: "^3.4.21"
127
+ typescript: "^5.4.5",
128
+ vitest: "^1.5.0",
129
+ vue: "^3.4.23"
138
130
  },
139
131
  engines: {
140
132
  node: ">=18.12.0"
@@ -154,7 +146,7 @@ var CROSS = c.red("\u2718");
154
146
  var WARN = c.yellow("\u2139");
155
147
  var vscodeSettingsString = `
156
148
  // Enable the ESlint flat config support
157
- "eslint.experimental.useFlatConfig": true,
149
+ "eslint.useFlatConfig": true,
158
150
 
159
151
  // Disable the default formatter, use eslint instead
160
152
  "prettier.enable": false,
@@ -218,7 +210,6 @@ var dependenciesMap = {
218
210
  };
219
211
 
220
212
  // src/cli/run.ts
221
- init_esm_shims();
222
213
  import fs3 from "node:fs";
223
214
  import path4 from "node:path";
224
215
  import process4 from "node:process";
@@ -226,7 +217,6 @@ import * as p4 from "@clack/prompts";
226
217
  import c5 from "picocolors";
227
218
 
228
219
  // src/cli/stages/update-eslint-files.ts
229
- init_esm_shims();
230
220
  import fs from "node:fs";
231
221
  import fsp from "node:fs/promises";
232
222
  import path from "node:path";
@@ -236,7 +226,6 @@ import parse from "parse-gitignore";
236
226
  import c2 from "picocolors";
237
227
 
238
228
  // src/cli/utils.ts
239
- init_esm_shims();
240
229
  import { execSync } from "node:child_process";
241
230
  function isGitClean() {
242
231
  try {
@@ -305,7 +294,6 @@ async function updateEslintFiles(result) {
305
294
  }
306
295
 
307
296
  // src/cli/stages/update-package-json.ts
308
- init_esm_shims();
309
297
  import fsp2 from "node:fs/promises";
310
298
  import path2 from "node:path";
311
299
  import process2 from "node:process";
@@ -357,7 +345,6 @@ async function updatePackageJson(result) {
357
345
  }
358
346
 
359
347
  // src/cli/stages/update-vscode-settings.ts
360
- init_esm_shims();
361
348
  import fs2 from "node:fs";
362
349
  import fsp3 from "node:fs/promises";
363
350
  import path3 from "node:path";