@1stg/eslint-config 9.1.0 → 10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#371](https://github.com/1stG/configs/pull/371) [`3cbd4b7`](https://github.com/1stG/configs/commit/3cbd4b734f2297e58f4f917165924a903100d655) Thanks [@JounQin](https://github.com/JounQin)! - feat!: migrate `eslint-plugin-unicorn` to `eslint-plugin-unicorn-x`
8
+
9
+ - [#372](https://github.com/1stG/configs/pull/372) [`f6e2755`](https://github.com/1stG/configs/commit/f6e27555b4ece8266418cfb371b0165b8749b42d) Thanks [@JounQin](https://github.com/JounQin)! - feat!: use `n.convertPath` setting for hashbang rule
10
+
3
11
  ## 9.1.0
4
12
 
5
13
  ### Minor Changes
package/_util.js CHANGED
@@ -25,7 +25,7 @@ if (isMonorepo()) {
25
25
  return acc
26
26
  }
27
27
  const { name, peerDependencies = {}, dependencies = {} } = pkgJson
28
- // eslint-disable-next-line unicorn/prefer-spread
28
+ // eslint-disable-next-line unicorn-x/prefer-spread
29
29
  return acc.concat(
30
30
  name,
31
31
  Object.keys(peerDependencies),
package/angular.js CHANGED
@@ -43,6 +43,6 @@ export const angular = tseslint.config(
43
43
  },
44
44
  {
45
45
  files: ['**/*inline-template-*.component.html'],
46
- rules: { 'unicorn/no-empty-file': 0 },
46
+ rules: { 'unicorn-x/no-empty-file': 0 },
47
47
  },
48
48
  )
package/base.js CHANGED
@@ -11,7 +11,7 @@ import promise from 'eslint-plugin-promise'
11
11
  import regexp from 'eslint-plugin-regexp'
12
12
  import simpleImportSort from 'eslint-plugin-simple-import-sort'
13
13
  import sonarjs from 'eslint-plugin-sonarjs'
14
- import unicorn from 'eslint-plugin-unicorn'
14
+ import unicornX from 'eslint-plugin-unicorn-x'
15
15
  import globals from 'globals'
16
16
  import tseslint from 'typescript-eslint'
17
17
 
@@ -32,7 +32,7 @@ export const base = tseslint.config([
32
32
  promise.configs['flat/recommended'],
33
33
  regexp.configs['flat/recommended'],
34
34
  sonarjs.configs.recommended,
35
- unicorn.configs.recommended,
35
+ unicornX.configs.recommended,
36
36
  prettierExtends,
37
37
  {
38
38
  name: '@1stg/node',
@@ -52,7 +52,13 @@ export const base = tseslint.config([
52
52
  'node_modules/@d-ts',
53
53
  'node_modules/@types',
54
54
  ],
55
- 'import-x/resolver-next': [createTypeScriptImportResolver()],
55
+ 'import-x/resolver-next': createTypeScriptImportResolver(),
56
+ n: {
57
+ convertPath: {
58
+ '**/bin.ts': [String.raw`^(src/)?bin\.ts$`, 'lib/bin.js'],
59
+ '**/cli.ts': [String.raw`^(src/)?cli\.ts$`, 'lib/cli.js'],
60
+ },
61
+ },
56
62
  },
57
63
  languageOptions: {
58
64
  sourceType: 'module',
@@ -116,9 +122,9 @@ export const base = tseslint.config([
116
122
  },
117
123
  ],
118
124
  'no-negated-condition': 2,
119
- 'no-process-exit': 0, // suspended by unicorn/no-process-exit
125
+ 'no-process-exit': 0, // suspended by unicorn-x/no-process-exit
120
126
 
121
- // The following rules are duplicate with `eslint-plugin-import`
127
+ // The following rules are duplicate with `eslint-plugin-import-x`
122
128
  'n/no-extraneous-import': 0,
123
129
  'n/no-extraneous-require': 0,
124
130
  'n/no-missing-import': 0,
@@ -131,15 +137,15 @@ export const base = tseslint.config([
131
137
  'prefer-const': [2, { destructuring: 'all' }],
132
138
  'prefer-object-spread': 2,
133
139
  'simple-import-sort/exports': 2,
134
- 'unicorn/catch-error-name': [
140
+ 'unicorn-x/catch-error-name': [
135
141
  2,
136
142
  {
137
143
  name: 'error',
138
144
  ignore: ['^e(rr)?$'],
139
145
  },
140
146
  ],
141
- 'unicorn/consistent-function-scoping': 0,
142
- 'unicorn/filename-case': [
147
+ 'unicorn-x/consistent-function-scoping': 0,
148
+ 'unicorn-x/filename-case': [
143
149
  2,
144
150
  {
145
151
  cases: {
@@ -150,13 +156,13 @@ export const base = tseslint.config([
150
156
  ignore: [/^[A-Z](([\dA-Z]+_)*[\dA-Z]+)?\.(mdx?|ya?ml)$/],
151
157
  },
152
158
  ],
153
- 'unicorn/no-array-reduce': 0,
154
- 'unicorn/no-null': 0,
155
- 'unicorn/no-unreadable-array-destructuring': 0, // conflict with `no-unused-vars`
156
- 'unicorn/prefer-module': 0,
157
- 'unicorn/prefer-object-from-entries': 0,
158
- 'unicorn/prevent-abbreviations': 0,
159
- 'unicorn/prefer-export-from': [2, { ignoreUsedVariables: true }],
159
+ 'unicorn-x/no-array-reduce': 0,
160
+ 'unicorn-x/no-null': 0,
161
+ 'unicorn-x/no-unreadable-array-destructuring': 0, // conflict with `no-unused-vars`
162
+ 'unicorn-x/prefer-module': 0,
163
+ 'unicorn-x/prefer-object-from-entries': 0,
164
+ 'unicorn-x/prevent-abbreviations': 0,
165
+ 'unicorn-x/prefer-export-from': [2, { ignoreUsedVariables: true }],
160
166
  },
161
167
  },
162
168
  {
package/loose.js CHANGED
@@ -28,12 +28,12 @@ export const loose = tseslint.config([
28
28
  'no-negated-condition': 0, // not auto-fixable
29
29
  'promise/always-return': 0,
30
30
  'promise/catch-or-return': 0,
31
- 'unicorn/explicit-length-check': 0,
32
- 'unicorn/no-array-for-each': 0,
33
- 'unicorn/no-fn-reference-in-iterator': 0,
34
- 'unicorn/prefer-number-properties': 0,
35
- 'unicorn/prefer-prototype-methods': 0,
36
- 'unicorn/prefer-spread': 0,
31
+ 'unicorn-x/explicit-length-check': 0,
32
+ 'unicorn-x/no-array-for-each': 0,
33
+ 'unicorn-x/no-fn-reference-in-iterator': 0,
34
+ 'unicorn-x/prefer-number-properties': 0,
35
+ 'unicorn-x/prefer-prototype-methods': 0,
36
+ 'unicorn-x/prefer-spread': 0,
37
37
  },
38
38
  },
39
39
  ])
package/overrides.js CHANGED
@@ -26,11 +26,6 @@ import { resolveSettings, tsBase } from './ts-base.js'
26
26
 
27
27
  export const ts = tseslint.config(
28
28
  tsBase,
29
- {
30
- name: '@1stg/cli',
31
- files: ['**/{bin,cli}.ts'],
32
- rules: { 'n/hashbang': 0 },
33
- },
34
29
  {
35
30
  name: '@1stg/code-block',
36
31
  files: ['**/*.{md,mdx}/**/*.{cts,mts,ts,tsx}'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "9.1.0",
3
+ "version": "10.0.0",
4
4
  "type": "module",
5
5
  "description": "Personal but Shareable ESLint Configuration for all 1stG.me projects",
6
6
  "repository": "git+https://github.com/1stG/configs.git",
@@ -87,7 +87,7 @@
87
87
  "eslint-plugin-simple-import-sort": "^12.1.1",
88
88
  "eslint-plugin-sonarjs": "^3.0.2",
89
89
  "eslint-plugin-toml": "^0.12.0",
90
- "eslint-plugin-unicorn": "^59.0.1",
90
+ "eslint-plugin-unicorn-x": "^1.0.7",
91
91
  "eslint-plugin-yml": "^1.18.0",
92
92
  "globals": "^16.1.0",
93
93
  "typescript-eslint": "^8.32.1"
package/ts-base.js CHANGED
@@ -129,10 +129,10 @@ export const tsBase = tseslint.config({
129
129
  'promise/always-return': 0,
130
130
  'promise/catch-or-return': 0,
131
131
  // ts itself has guaranteed it
132
- 'unicorn/no-array-callback-reference': 0,
132
+ 'unicorn-x/no-array-callback-reference': 0,
133
133
  // covered by @typescript-eslint/no-extraneous-class
134
- 'unicorn/no-static-only-class': 0,
134
+ 'unicorn-x/no-static-only-class': 0,
135
135
  // covered by @typescript-eslint/no-this-alias
136
- 'unicorn/no-this-assignment': 0,
136
+ 'unicorn-x/no-this-assignment': 0,
137
137
  },
138
138
  })