@isentinel/eslint-config 3.5.0 → 4.0.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.
package/README.md CHANGED
@@ -260,6 +260,43 @@ for more details.
260
260
  > [sxzz/eslint-config](https://github.com/sxzz/eslint-config) for the
261
261
  > inspiration and reference.
262
262
 
263
+ ### Editor Mode
264
+
265
+ By default, this config auto-detects whether ESLint is running in an editor
266
+ environment (VS Code, JetBrains IDEs, Vim, Neovim) and adjusts certain rules
267
+ accordingly. In editor mode:
268
+
269
+ - `unused-imports/no-unused-imports` is downgraded to "warn" instead of "error"
270
+ - Auto-fix is disabled for certain rules to prevent unwanted changes while
271
+ editing
272
+ - Other rules are adjusted for a better development experience
273
+
274
+ You can explicitly control this behavior using the `ESLINT_IN_EDITOR`
275
+ environment variable:
276
+
277
+ ```bash
278
+ # Force editor mode (useful for AI agents or hooks)
279
+ ESLINT_IN_EDITOR=true eslint --fix
280
+
281
+ # Force non-editor mode
282
+ ESLINT_IN_EDITOR=false eslint --fix
283
+ ```
284
+
285
+ This is particularly useful when running ESLint from CLI tools or AI agents that
286
+ make multiple changes, as it prevents imports from being removed before the code
287
+ that uses them is written.
288
+
289
+ Alternatively, you can set it explicitly in your config:
290
+
291
+ ```ts
292
+ // eslint.config.ts
293
+ import isentinel from "@isentinel/eslint-config";
294
+
295
+ export default isentinel({
296
+ isInEditor: true, // or false
297
+ });
298
+ ```
299
+
263
300
  ### Plugins Renaming
264
301
 
265
302
  Since flat config requires us to explicitly provide the plugin names (instead of
@@ -389,7 +426,7 @@ Running `npx eslint` should prompt you to install the required dependencies,
389
426
  otherwise, you can install them manually:
390
427
 
391
428
  ```bash
392
- pnpm i -D @eslint-react/eslint-plugin eslint-plugin-react-roblox-hooks eslint-plugin-jest
429
+ pnpm i -D eslint-plugin-react-x eslint-plugin-react-hooks eslint-plugin-react-naming-convention eslint-plugin-jest
393
430
  ```
394
431
 
395
432
  #### ESLint Plugin Development
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -10,178 +10,160 @@ import { existsSync, readFileSync } from "fs";
10
10
  import { execSync } from "node:child_process";
11
11
 
12
12
  //#region package.json
13
- var name = "@isentinel/eslint-config";
14
- var version = "3.5.0";
15
- var description = "iSentinel's ESLint config";
16
- var keywords = [
17
- "eslint-config",
18
- "roblox",
19
- "roblox-ts",
20
- "rbxts"
21
- ];
22
- var homepage = "https://github.com/christopher-buss/eslint-config";
23
- var repository = {
24
- "type": "git",
25
- "url": "git+https://github.com/christopher-buss/eslint-config.git"
26
- };
27
- var license = "MIT";
28
- var author = "Christopher Buss <christopher.buss@pm.me> (https://github.com/christopher-buss)";
29
- var contributors = ["Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)"];
30
- var type = "module";
31
- var exports = { ".": "./dist/index.js" };
32
- var main = "./dist/index.js";
33
- var types = "./dist/index.d.ts";
34
- var bin = "./bin/index.js";
35
- var files = ["bin", "dist"];
36
- var scripts = {
37
- "build": "nr gen && tsdown --clean --dts",
38
- "build:inspector": "pnpm build && npx @eslint/config-inspector build --config eslint-inspector.config.ts",
39
- "dev": "npx @eslint/config-inspector --config eslint-inspector.config.ts",
40
- "gen": "tsx scripts/typegen.ts && tsx scripts/versiongen.ts",
41
- "postgen": "echo 'Generation complete!'",
42
- "lint": "eslint --cache",
43
- "lint:ci": "eslint --cache --cache-strategy content",
44
- "prepack": "nr build",
45
- "prepare": "simple-git-hooks",
46
- "release": "bumpp",
47
- "stub": "tsdown",
48
- "typecheck": "tsc --noEmit",
49
- "watch": "tsdown --watch --dts"
50
- };
51
- var simple_git_hooks = { "pre-commit": "pnpm lint-staged" };
52
- var lint_staged = { "*": "eslint --fix --cache" };
53
- var dependencies = {
54
- "@antfu/install-pkg": "catalog:prod",
55
- "@clack/prompts": "catalog:prod",
56
- "@cspell/eslint-plugin": "catalog:prod",
57
- "@eslint-community/eslint-plugin-eslint-comments": "catalog:prod",
58
- "@eslint/compat": "catalog:prod",
59
- "@eslint/markdown": "catalog:prod",
60
- "@isentinel/dict-rbxts": "catalog:prod",
61
- "@isentinel/dict-roblox": "catalog:prod",
62
- "@isentinel/eslint-plugin-comment-length": "catalog:prod",
63
- "@prettier/plugin-oxc": "catalog:prod",
64
- "@shopify/eslint-plugin": "catalog:prod",
65
- "@stylistic/eslint-plugin": "catalog:prod",
66
- "@typescript-eslint/eslint-plugin": "catalog:prod",
67
- "@typescript-eslint/parser": "catalog:prod",
68
- "ansis": "catalog:prod",
69
- "eslint-config-flat-gitignore": "catalog:prod",
70
- "eslint-config-prettier": "catalog:prod",
71
- "eslint-flat-config-utils": "catalog:prod",
72
- "eslint-import-resolver-node": "catalog:prod",
73
- "eslint-merge-processors": "catalog:prod",
74
- "eslint-plugin-antfu": "catalog:prod",
75
- "eslint-plugin-arrow-return-style-x": "catalog:prod",
76
- "eslint-plugin-better-max-params": "catalog:prod",
77
- "eslint-plugin-de-morgan": "catalog:prod",
78
- "eslint-plugin-flawless": "catalog:prod",
79
- "eslint-plugin-format-lua": "catalog:prod",
80
- "eslint-plugin-import-lite": "catalog:prod",
81
- "eslint-plugin-jsdoc": "catalog:prod",
82
- "eslint-plugin-jsonc": "catalog:prod",
83
- "eslint-plugin-no-only-tests": "catalog:prod",
84
- "eslint-plugin-package-json": "catalog:prod",
85
- "eslint-plugin-perfectionist": "catalog:prod",
86
- "eslint-plugin-pnpm": "catalog:prod",
87
- "eslint-plugin-prettier": "catalog:prod",
88
- "eslint-plugin-promise": "catalog:prod",
89
- "eslint-plugin-roblox-ts": "catalog:prod",
90
- "eslint-plugin-sentinel": "catalog:prod",
91
- "eslint-plugin-sonarjs": "catalog:prod",
92
- "eslint-plugin-toml": "catalog:prod",
93
- "eslint-plugin-unicorn": "catalog:prod",
94
- "eslint-plugin-yml": "catalog:prod",
95
- "jsonc-eslint-parser": "catalog:prod",
96
- "local-pkg": "catalog:prod",
97
- "prettier": "catalog:prod",
98
- "prettier-plugin-jsdoc": "catalog:prod",
99
- "prompts": "catalog:prod",
100
- "toml-eslint-parser": "catalog:prod",
101
- "yaml-eslint-parser": "catalog:prod",
102
- "yargs": "catalog:prod"
103
- };
104
- var devDependencies = {
105
- "@antfu/ni": "catalog:dev",
106
- "@eslint-react/eslint-plugin": "catalog:peer",
107
- "@eslint/config-inspector": "catalog:dev",
108
- "@isentinel/eslint-config": "workspace:*",
109
- "@isentinel/tsconfig": "catalog:dev",
110
- "@stylistic/eslint-plugin-migrate": "catalog:dev",
111
- "@types/fs-extra": "catalog:dev",
112
- "@types/node": "catalog:dev",
113
- "@types/prompts": "catalog:dev",
114
- "@types/yargs": "catalog:dev",
115
- "@vitest/eslint-plugin": "catalog:peer",
116
- "bumpp": "catalog:dev",
117
- "eslint": "catalog:peer",
118
- "eslint-plugin-erasable-syntax-only": "catalog:peer",
119
- "eslint-plugin-eslint-plugin": "catalog:peer",
120
- "eslint-plugin-jest": "catalog:peer",
121
- "eslint-plugin-n": "catalog:peer",
122
- "eslint-plugin-react-roblox-hooks": "catalog:peer",
123
- "eslint-plugin-unused-imports": "catalog:dev",
124
- "eslint-typegen": "catalog:dev",
125
- "esno": "catalog:dev",
126
- "execa": "catalog:dev",
127
- "fast-glob": "catalog:dev",
128
- "fs-extra": "catalog:dev",
129
- "jiti": "catalog:dev",
130
- "lint-staged": "catalog:dev",
131
- "parse-gitignore-ts": "catalog:dev",
132
- "pnpm-workspace-yaml": "catalog:dev",
133
- "rimraf": "catalog:dev",
134
- "simple-git-hooks": "catalog:dev",
135
- "tsdown": "catalog:dev",
136
- "type-fest": "catalog:dev",
137
- "typescript": "catalog:dev"
138
- };
139
- var peerDependencies = {
140
- "@eslint-react/eslint-plugin": "^1.45.0",
141
- "@vitest/eslint-plugin": "^1.0.0",
142
- "eslint": "^9.10.0",
143
- "eslint-plugin-eslint-plugin": "^7.0.0",
144
- "eslint-plugin-jest": "^28.9.0 || ^29.0.0",
145
- "eslint-plugin-n": "^17.0.0",
146
- "eslint-plugin-react-roblox-hooks": "^5.1.0-rbx.1"
147
- };
148
- var peerDependenciesMeta = {
149
- "@eslint-react/eslint-plugin": { "optional": true },
150
- "@vitest/eslint-plugin": { "optional": true },
151
- "eslint-plugin-eslint-plugin": { "optional": true },
152
- "eslint-plugin-jest": { "optional": true },
153
- "eslint-plugin-n": { "optional": true },
154
- "eslint-plugin-react-roblox-hooks": { "optional": true }
155
- };
156
- var packageManager = "pnpm@10.15.1";
157
- var engines = { "node": ">=22.16.0" };
158
- var publishConfig = { "access": "public" };
13
+ var version = "4.0.0";
159
14
  var package_default = {
160
- name,
15
+ name: "@isentinel/eslint-config",
161
16
  version,
162
- description,
163
- keywords,
164
- homepage,
165
- repository,
166
- license,
167
- author,
168
- contributors,
169
- type,
170
- exports,
171
- main,
172
- types,
173
- bin,
174
- files,
175
- scripts,
176
- "simple-git-hooks": simple_git_hooks,
177
- "lint-staged": lint_staged,
178
- dependencies,
179
- devDependencies,
180
- peerDependencies,
181
- peerDependenciesMeta,
182
- packageManager,
183
- engines,
184
- publishConfig
17
+ description: "iSentinel's ESLint config",
18
+ keywords: [
19
+ "eslint-config",
20
+ "roblox",
21
+ "roblox-ts",
22
+ "rbxts"
23
+ ],
24
+ homepage: "https://github.com/christopher-buss/eslint-config",
25
+ repository: {
26
+ "type": "git",
27
+ "url": "git+https://github.com/christopher-buss/eslint-config.git"
28
+ },
29
+ license: "MIT",
30
+ author: "Christopher Buss <christopher.buss@pm.me> (https://github.com/christopher-buss)",
31
+ contributors: ["Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)"],
32
+ type: "module",
33
+ exports: { ".": "./dist/index.mjs" },
34
+ main: "./dist/index.mjs",
35
+ types: "./dist/index.d.mts",
36
+ bin: "./bin/index.js",
37
+ files: ["bin", "dist"],
38
+ scripts: {
39
+ "build": "nr gen && tsdown --clean --dts",
40
+ "build:inspector": "pnpm build && pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
41
+ "dev": "npx @eslint/config-inspector --config eslint-inspector.config.ts",
42
+ "gen": "tsx scripts/typegen.ts && tsx scripts/versiongen.ts",
43
+ "postgen": "echo 'Generation complete!'",
44
+ "lint": "eslint --cache",
45
+ "lint:ci": "eslint --cache --cache-strategy content",
46
+ "prepack": "nr build",
47
+ "prepare": "simple-git-hooks",
48
+ "release": "bumpp",
49
+ "stub": "tsdown",
50
+ "typecheck": "tsc --noEmit",
51
+ "watch": "tsdown --watch --dts"
52
+ },
53
+ "simple-git-hooks": { "pre-commit": "pnpm lint-staged" },
54
+ "lint-staged": {
55
+ "*": "eslint --fix --cache",
56
+ "*.ts": ["sh -c 'tsc --noEmit'"]
57
+ },
58
+ dependencies: {
59
+ "@antfu/install-pkg": "catalog:prod",
60
+ "@clack/prompts": "catalog:prod",
61
+ "@cspell/eslint-plugin": "catalog:prod",
62
+ "@eslint-community/eslint-plugin-eslint-comments": "catalog:prod",
63
+ "@eslint/compat": "catalog:prod",
64
+ "@eslint/markdown": "catalog:prod",
65
+ "@isentinel/dict-rbxts": "catalog:prod",
66
+ "@isentinel/dict-roblox": "catalog:prod",
67
+ "@isentinel/eslint-plugin-comment-length": "catalog:prod",
68
+ "@prettier/plugin-oxc": "catalog:prod",
69
+ "@shopify/eslint-plugin": "catalog:prod",
70
+ "@stylistic/eslint-plugin": "catalog:prod",
71
+ "@typescript-eslint/eslint-plugin": "catalog:prod",
72
+ "@typescript-eslint/parser": "catalog:prod",
73
+ "ansis": "catalog:prod",
74
+ "eslint-config-flat-gitignore": "catalog:prod",
75
+ "eslint-config-prettier": "catalog:prod",
76
+ "eslint-flat-config-utils": "catalog:prod",
77
+ "eslint-import-resolver-node": "catalog:prod",
78
+ "eslint-merge-processors": "catalog:prod",
79
+ "eslint-plugin-antfu": "catalog:prod",
80
+ "eslint-plugin-arrow-return-style-x": "catalog:prod",
81
+ "eslint-plugin-better-max-params": "catalog:prod",
82
+ "eslint-plugin-de-morgan": "catalog:prod",
83
+ "eslint-plugin-flawless": "catalog:prod",
84
+ "eslint-plugin-format-lua": "catalog:prod",
85
+ "eslint-plugin-import-lite": "catalog:prod",
86
+ "eslint-plugin-jsdoc": "catalog:prod",
87
+ "eslint-plugin-jsonc": "catalog:prod",
88
+ "eslint-plugin-no-only-tests": "catalog:prod",
89
+ "eslint-plugin-package-json": "catalog:prod",
90
+ "eslint-plugin-perfectionist": "catalog:prod",
91
+ "eslint-plugin-pnpm": "catalog:prod",
92
+ "eslint-plugin-prettier": "catalog:prod",
93
+ "eslint-plugin-promise": "catalog:prod",
94
+ "eslint-plugin-roblox-ts": "catalog:prod",
95
+ "eslint-plugin-sentinel": "catalog:prod",
96
+ "eslint-plugin-sonarjs": "catalog:prod",
97
+ "eslint-plugin-toml": "catalog:prod",
98
+ "eslint-plugin-unicorn": "catalog:prod",
99
+ "eslint-plugin-unused-imports": "catalog:prod",
100
+ "eslint-plugin-yml": "catalog:prod",
101
+ "find-up-simple": "catalog:prod",
102
+ "jsonc-eslint-parser": "catalog:prod",
103
+ "local-pkg": "catalog:prod",
104
+ "prettier": "catalog:prod",
105
+ "prettier-plugin-jsdoc": "catalog:prod",
106
+ "prompts": "catalog:prod",
107
+ "toml-eslint-parser": "catalog:prod",
108
+ "yaml-eslint-parser": "catalog:prod",
109
+ "yargs": "catalog:prod"
110
+ },
111
+ devDependencies: {
112
+ "@antfu/ni": "catalog:dev",
113
+ "@eslint/config-inspector": "catalog:dev",
114
+ "@isentinel/eslint-config": "workspace:*",
115
+ "@isentinel/tsconfig": "catalog:dev",
116
+ "@stylistic/eslint-plugin-migrate": "catalog:dev",
117
+ "@types/fs-extra": "catalog:dev",
118
+ "@types/node": "catalog:dev",
119
+ "@types/prompts": "catalog:dev",
120
+ "@types/yargs": "catalog:dev",
121
+ "@vitest/eslint-plugin": "catalog:peer",
122
+ "bumpp": "catalog:dev",
123
+ "eslint": "catalog:peer",
124
+ "eslint-plugin-erasable-syntax-only": "catalog:peer",
125
+ "eslint-plugin-eslint-plugin": "catalog:peer",
126
+ "eslint-plugin-jest": "catalog:peer",
127
+ "eslint-plugin-n": "catalog:peer",
128
+ "eslint-plugin-react-hooks": "catalog:peer",
129
+ "eslint-plugin-react-naming-convention": "catalog:peer",
130
+ "eslint-plugin-react-x": "catalog:peer",
131
+ "eslint-typegen": "catalog:dev",
132
+ "esno": "catalog:dev",
133
+ "execa": "catalog:dev",
134
+ "fast-glob": "catalog:dev",
135
+ "fs-extra": "catalog:dev",
136
+ "jiti": "catalog:dev",
137
+ "lint-staged": "catalog:dev",
138
+ "parse-gitignore-ts": "catalog:dev",
139
+ "pnpm-workspace-yaml": "catalog:dev",
140
+ "rimraf": "catalog:dev",
141
+ "simple-git-hooks": "catalog:dev",
142
+ "tsdown": "catalog:dev",
143
+ "type-fest": "catalog:dev",
144
+ "typescript": "catalog:dev"
145
+ },
146
+ peerDependencies: {
147
+ "@eslint-react/eslint-plugin": "^2.3.1",
148
+ "@vitest/eslint-plugin": "^1.0.0",
149
+ "eslint": "^9.10.0",
150
+ "eslint-plugin-eslint-plugin": "^7.0.0",
151
+ "eslint-plugin-jest": "^28.9.0 || ^29.0.0",
152
+ "eslint-plugin-n": "^17.0.0",
153
+ "eslint-plugin-react-hooks": "^7.0.0",
154
+ "eslint-plugin-react-naming-convention": "^2.3.1"
155
+ },
156
+ peerDependenciesMeta: {
157
+ "@eslint-react/eslint-plugin": { "optional": true },
158
+ "@vitest/eslint-plugin": { "optional": true },
159
+ "eslint-plugin-eslint-plugin": { "optional": true },
160
+ "eslint-plugin-jest": { "optional": true },
161
+ "eslint-plugin-n": { "optional": true },
162
+ "eslint-plugin-react-hooks": { "optional": true }
163
+ },
164
+ packageManager: "pnpm@10.20.0",
165
+ engines: { "node": ">=22.16.0" },
166
+ publishConfig: { "access": "public" }
185
167
  };
186
168
 
187
169
  //#endregion
@@ -232,7 +214,11 @@ const frameworkOptions = [{
232
214
  }];
233
215
  const frameworks = frameworkOptions.map(({ value }) => value);
234
216
  const dependenciesMap = {
235
- react: ["@eslint-react/eslint-plugin", "eslint-plugin-react-roblox-hooks"],
217
+ react: [
218
+ "eslint-plugin-react-x",
219
+ "eslint-plugin-react-hooks",
220
+ "eslint-plugin-react-naming-convention"
221
+ ],
236
222
  test: ["eslint-plugin-jest"]
237
223
  };
238
224
 
@@ -374,13 +360,13 @@ var dedupe = (input, options = {}) => {
374
360
  };
375
361
  var glob = (pattern, options) => {
376
362
  if (GLOBSTAR_REGEX.test(pattern)) return pattern;
377
- let relative = false;
363
+ let relative$1 = false;
378
364
  if (pattern.startsWith("/")) {
379
365
  pattern = pattern.slice(1);
380
- relative = true;
381
- } else if (pattern.slice(1, pattern.length - 1).includes("/")) relative = true;
366
+ relative$1 = true;
367
+ } else if (pattern.slice(1, pattern.length - 1).includes("/")) relative$1 = true;
382
368
  pattern += pattern.endsWith("/") ? "**/" : "/**";
383
- return relative ? pattern : `**/${pattern}`;
369
+ return relative$1 ? pattern : `**/${pattern}`;
384
370
  };
385
371
  var globs = (input, options = {}) => {
386
372
  const parsed = parse(input, options);
@@ -480,16 +466,14 @@ async function updateEslintFiles(result) {
480
466
  const eslintIgnores = [];
481
467
  if (fs.existsSync(pathESLintIgnore)) {
482
468
  log.step(ansis.cyan("Migrating existing .eslintignore"));
483
- const content = await fsp.readFile(pathESLintIgnore, "utf-8");
484
- const globs$1 = index_default(content).globs();
469
+ const globs$1 = index_default(await fsp.readFile(pathESLintIgnore, "utf-8")).globs();
485
470
  for (const glob$1 of globs$1) if (glob$1.type === "ignore") eslintIgnores.push(...glob$1.patterns);
486
471
  else eslintIgnores.push(...glob$1.patterns.map((pattern) => `!${pattern}`));
487
472
  }
488
473
  const configLines = [];
489
474
  if (eslintIgnores.length) configLines.push(`ignores: ${JSON.stringify(eslintIgnores)},`);
490
475
  for (const framework of result.frameworks) configLines.push(`${framework}: true,`);
491
- const mainConfig = configLines.map((index) => ` ${index}`).join("\n");
492
- const eslintConfigContent = getEslintConfigContent(mainConfig, []);
476
+ const eslintConfigContent = getEslintConfigContent(configLines.map((index) => ` ${index}`).join("\n"), []);
493
477
  await fsp.writeFile(pathFlatConfig, eslintConfigContent);
494
478
  log.success(ansis.green(`Created ${configFileName}`));
495
479
  const files$1 = fs.readdirSync(cwd);
@@ -501,10 +485,11 @@ async function updateEslintFiles(result) {
501
485
  //#endregion
502
486
  //#region src/cli/constants-generated.ts
503
487
  const versionsMap = {
504
- "@eslint-react/eslint-plugin": "1.53.1",
505
- "eslint": "9.35.0",
488
+ "eslint": "9.39.1",
506
489
  "eslint-plugin-jest": "29.0.1",
507
- "eslint-plugin-react-roblox-hooks": "5.1.0-rbx.1"
490
+ "eslint-plugin-react-hooks": "7.0.1",
491
+ "eslint-plugin-react-naming-convention": "2.3.1",
492
+ "eslint-plugin-react-x": "2.3.1"
508
493
  };
509
494
 
510
495
  //#endregion