@1stg/eslint-config 12.0.2 → 12.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 12.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#457](https://github.com/1stG/configs/pull/457) [`eb778e9`](https://github.com/1stG/configs/commit/eb778e937c9225f5f38c47bf5b14b90b24510e2a) Thanks [@JounQin](https://github.com/JounQin)! - Restore recommended-rule coverage by reusing `oxlint-config-recommended` for the
8
+ supported ESLint, typescript-eslint, and Unicorn rules. ESLint reuses
9
+ `eslint-plugin-unicorn` recommended; `eslint-plugin-oxlint` disables the rules
10
+ already covered by Oxlint. Code mode is inferred from `typescript-eslint`, so
11
+ consumers without it keep it disabled. Unicorn rules that conflict with Oxfmt
12
+ comments or would force public API renames are disabled. The legacy TypeScript
13
+ exception for `no-array-callback-reference` is preserved.
14
+
3
15
  ## 12.0.2
4
16
 
5
17
  ### Patch Changes
package/lib/index.js CHANGED
@@ -16,7 +16,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
16
16
  return path;
17
17
  };
18
18
  import oxlint from 'eslint-plugin-oxlint';
19
- const NODE_MAJOR = Number(process.versions.node.split('.')[0]);
19
+ const NODE_MAJOR = Number(process.versions.node.split('.', 1)[0]);
20
20
  const supportsMarkup = NODE_MAJOR >= 24;
21
21
  const CODE_IGNORES = '**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}';
22
22
  const DEFAULT_IGNORES = [
@@ -58,9 +58,21 @@ const isInstalled = (name) => {
58
58
  /** Dynamic import that also unwraps a CommonJS default export. */
59
59
  const load = (name) => __awaiter(void 0, void 0, void 0, function* () {
60
60
  var _a;
61
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- dynamic import
61
62
  const mod = (yield import(__rewriteRelativeImportExtension(name, true)));
63
+ // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- CJS default
62
64
  return ((_a = mod.default) !== null && _a !== void 0 ? _a : mod);
63
65
  });
66
+ const buildUnicornConfigs = () => __awaiter(void 0, void 0, void 0, function* () {
67
+ if (!isInstalled('eslint-plugin-unicorn')) {
68
+ /* istanbul ignore next -- optional peer */
69
+ return [];
70
+ }
71
+ const unicorn = yield load('eslint-plugin-unicorn');
72
+ return toConfigs(unicorn.configs.recommended).map(config => withCodeFiles(Object.assign(Object.assign({}, config), { rules: Object.assign(Object.assign({}, config.rules), { 'unicorn/consistent-boolean-name': 'off', 'unicorn/no-asterisk-prefix-in-documentation-comments': 'off', 'unicorn/no-useless-iterator-to-array': 'off', 'unicorn/single-line-block-comment-style': 'off',
73
+ // renamed from `prevent-abbreviations`, which legacy disabled.
74
+ 'unicorn/name-replacements': 'off' }) })));
75
+ });
64
76
  /**
65
77
  * Build the flat ESLint config for the file types Oxlint does not parse.
66
78
  *
@@ -92,6 +104,7 @@ export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0
92
104
  const regexp = yield load('eslint-plugin-regexp');
93
105
  configs.push(...toConfigs(regexp.configs['flat/recommended']).map(withCodeFiles));
94
106
  }
107
+ configs.push(...(yield buildUnicornConfigs()));
95
108
  }
96
109
  configs.push(...toConfigs(oxlint.configs['flat/all']));
97
110
  if (markdown) {
@@ -112,5 +125,6 @@ export const defineConfig = (...args_1) => __awaiter(void 0, [...args_1], void 0
112
125
  }
113
126
  return configs;
114
127
  });
128
+ // oxlint-disable-next-line unicorn/prefer-top-level-await -- keep the Promise API for ESLint
115
129
  const config = defineConfig();
116
130
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "12.0.2",
3
+ "version": "12.1.0",
4
4
  "type": "module",
5
5
  "description": "Personal but Shareable ESLint Configuration for the files Oxlint cannot lint",
6
6
  "repository": "git+https://github.com/1stG/configs.git",
@@ -24,11 +24,12 @@
24
24
  "lib"
25
25
  ],
26
26
  "peerDependencies": {
27
- "eslint": "^9.39.4 || ^10.0.1",
27
+ "eslint": "^10.4.0",
28
28
  "eslint-plugin-markup": "^2.1.0",
29
29
  "eslint-plugin-regexp": "^3.3.1",
30
30
  "eslint-plugin-sonarjs": "^4.2.2",
31
31
  "eslint-plugin-toml": "^1.5.0",
32
+ "eslint-plugin-unicorn": "^79.0.0",
32
33
  "eslint-plugin-yml": "^3.9.0",
33
34
  "typescript-eslint": "^8.72.0"
34
35
  },
@@ -45,6 +46,9 @@
45
46
  "eslint-plugin-toml": {
46
47
  "optional": true
47
48
  },
49
+ "eslint-plugin-unicorn": {
50
+ "optional": true
51
+ },
48
52
  "eslint-plugin-yml": {
49
53
  "optional": true
50
54
  },