eslint-plugin-typefest 1.0.10 → 1.2.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 +95 -98
- package/dist/_internal/imported-value-symbols.d.ts.map +1 -1
- package/dist/_internal/imported-value-symbols.js +1 -2
- package/dist/_internal/imported-value-symbols.js.map +1 -1
- package/dist/_internal/rule-catalog.d.ts.map +1 -1
- package/dist/_internal/rule-catalog.js +2 -0
- package/dist/_internal/rule-catalog.js.map +1 -1
- package/dist/_internal/rules-registry.d.ts.map +1 -1
- package/dist/_internal/rules-registry.js +0 -6
- package/dist/_internal/rules-registry.js.map +1 -1
- package/dist/plugin.cjs +70 -208
- package/dist/plugin.cjs.map +3 -3
- package/docs/rules/presets/all.md +0 -3
- package/docs/rules/presets/experimental.md +97 -100
- package/docs/rules/presets/index.md +0 -3
- package/docs/rules/presets/strict.md +0 -1
- package/package.json +68 -67
- package/dist/rules/prefer-ts-extras-array-find-last-index.d.ts +0 -13
- package/dist/rules/prefer-ts-extras-array-find-last-index.d.ts.map +0 -1
- package/dist/rules/prefer-ts-extras-array-find-last-index.js +0 -62
- package/dist/rules/prefer-ts-extras-array-find-last-index.js.map +0 -1
- package/dist/rules/prefer-ts-extras-array-find-last.d.ts +0 -13
- package/dist/rules/prefer-ts-extras-array-find-last.d.ts.map +0 -1
- package/dist/rules/prefer-ts-extras-array-find-last.js +0 -65
- package/dist/rules/prefer-ts-extras-array-find-last.js.map +0 -1
- package/dist/rules/prefer-ts-extras-array-find.d.ts +0 -13
- package/dist/rules/prefer-ts-extras-array-find.d.ts.map +0 -1
- package/dist/rules/prefer-ts-extras-array-find.js +0 -62
- package/dist/rules/prefer-ts-extras-array-find.js.map +0 -1
- package/docs/rules/prefer-ts-extras-array-find-last-index.md +0 -108
- package/docs/rules/prefer-ts-extras-array-find-last.md +0 -108
- package/docs/rules/prefer-ts-extras-array-find.md +0 -108
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "eslint-plugin-typefest",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "ESLint rules for adopting type-fest and ts-extras conventions.",
|
|
7
7
|
"keywords": [
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
"CHANGELOG.md"
|
|
55
55
|
],
|
|
56
56
|
"workspaces": [
|
|
57
|
-
"docs/docusaurus"
|
|
58
|
-
"packages/*"
|
|
57
|
+
"docs/docusaurus"
|
|
59
58
|
],
|
|
60
59
|
"scripts": {
|
|
61
60
|
"prebench": "npm run build",
|
|
@@ -111,10 +110,8 @@
|
|
|
111
110
|
"docs:build": "npm run --workspace docs/docusaurus build",
|
|
112
111
|
"docs:build:local": "npm run --workspace docs/docusaurus build:local",
|
|
113
112
|
"docs:check-links": "npm run docs:api && node ./scripts/check-doc-links.mjs",
|
|
114
|
-
"docs:check-site-contract": "node packages/docusaurus-site-contract/cli.mjs --config docs/docusaurus/site-contract.config.mjs",
|
|
115
113
|
"docs:devtools:metadata": "node scripts/generate-devtools-workspace-metadata.mjs",
|
|
116
114
|
"docs:serve": "npm run --workspace docs/docusaurus serve",
|
|
117
|
-
"docs:site-contract:init": "node packages/docusaurus-site-contract/cli.mjs init --root . --skip-vendor-package",
|
|
118
115
|
"docs:start": "npm run --workspace docs/docusaurus start",
|
|
119
116
|
"docs:start:devtools": "npm run docs:devtools:metadata && npm run docs:api:local && npm run --workspace docs/docusaurus start:devtools",
|
|
120
117
|
"docs:toc": "remark docs --use remark-toc --output",
|
|
@@ -123,7 +120,7 @@
|
|
|
123
120
|
"docs:typedoc:local": "npm run --workspace docs/docusaurus docs:api:local",
|
|
124
121
|
"docs:validate-links": "remark docs --use remark-validate-links --frail",
|
|
125
122
|
"knip": "cross-env NODE_OPTIONS=--max_old_space_size=4096 NODE_NO_WARNINGS=1 npx knip -c knip.config.ts --include-libs --cache --cache-location .cache/knip --tsConfig tsconfig.json",
|
|
126
|
-
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache",
|
|
123
|
+
"lint": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache",
|
|
127
124
|
"lint:action": "npm run lint:actions",
|
|
128
125
|
"lint:actions": "node scripts/lint-actionlint.mjs",
|
|
129
126
|
"lint:all": "npm run lint && npm run lint:css && npm run lint:prettier && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml && npm run lint:actions && npm run lint:circular",
|
|
@@ -143,18 +140,19 @@
|
|
|
143
140
|
"lint:dupes:skiplocal:all": "jscpd src/ --skipLocal --config jscpd.json --min-lines 3",
|
|
144
141
|
"lint:duplicates": "npm run lint:dupes",
|
|
145
142
|
"lint:exports": "ts-unused-exports tsconfig.json src/plugin.ts --excludePathsFromReport=plugin.ts",
|
|
146
|
-
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix",
|
|
147
|
-
"lint:fix:quiet": "cross-env ESLINT_PROGRESS=off NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix && echo \"Eslint fix done!\"",
|
|
143
|
+
"lint:fix": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache --fix",
|
|
144
|
+
"lint:fix:quiet": "cross-env ESLINT_PROGRESS=off NODE_OPTIONS=--max_old_space_size=16384 eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache --fix && echo \"Eslint fix done!\"",
|
|
148
145
|
"lint:grype": "grype . -c .grype.yaml --name eslint-plugin-typefest",
|
|
149
146
|
"lint:knip": "npm run knip",
|
|
150
147
|
"lint:knip:exports": "npm run knip -- --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates",
|
|
151
148
|
"lint:knip:unused:exports": "npm run knip -- --dependencies --exports",
|
|
152
149
|
"lint:leaves": "npm run madge:leaves",
|
|
153
150
|
"lint:metrics": "npm run sloc",
|
|
151
|
+
"lint:nocache": "cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint .",
|
|
154
152
|
"lint:node-version-files": "node scripts/sync-node-version-files.mjs --check",
|
|
155
153
|
"lint:orphans": "npm run madge:orphans",
|
|
156
154
|
"lint:package": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
157
|
-
"lint:package:strict": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:package-check && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
155
|
+
"lint:package:strict": "npm run lint:node-version-files && npm run lint:package-sort && npm run lint:package-check:strict && npm run lint:packagelintrc && echo \"Package.json lint done!\"",
|
|
158
156
|
"lint:package-check": "publint && attw --pack .",
|
|
159
157
|
"lint:package-check:strict": "publint && attw --pack . --profile strict",
|
|
160
158
|
"lint:package-sort": "sort-package-json \"./package.json\" \"./docs/docusaurus/package.json\"",
|
|
@@ -163,7 +161,7 @@
|
|
|
163
161
|
"lint:prettier": "prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --check",
|
|
164
162
|
"lint:prettier:fix": "prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --write",
|
|
165
163
|
"lint:publint": "publint",
|
|
166
|
-
"lint:quiet": "cross-env ESLINT_PROGRESS=nofile NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache && echo \"Eslint done!\"",
|
|
164
|
+
"lint:quiet": "cross-env ESLINT_PROGRESS=nofile NODE_OPTIONS=--max_old_space_size=16384 eslint . --cache --cache-strategy content --cache-location .cache/.eslintcache && echo \"Eslint done!\"",
|
|
167
165
|
"lint:remark": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\" --quiet",
|
|
168
166
|
"lint:remark:fix": "prettier --log-level warn --ignore-path prettierignore.remark --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --no-error-on-unmatched-pattern --write \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\" && npm run remark:fix",
|
|
169
167
|
"lint:secretlint": "secretlint --secretlintrc .secretlintrc.json --secretlintignore .secretlintignore \"./*\" \".vscode/**\" \"assets/**\" \"src/**\" \"electron/**\" \"shared/**\" \"config/**\" \"scripts/**\" \"playwright/**\" \"storybook/**\" \".storybook\" \"tests/**\" \"benchmarks/**\" \".devin/**\" \"public/**\" \".github/**\" \"docs/Architecture/**\" \"docs/*\" \"docs/assets/**\" \"docs/Guides/**\" \"docs/Testing/**\" \"docs/TSDoc/**\" \"docs/docusaurus/src/**\" \"docs/docusaurus/static/**\" \"docs/docusaurus/blog/**\" \"docs/docusaurus/docs/**\" \"docs/docusaurus/docs/*\"",
|
|
@@ -178,7 +176,7 @@
|
|
|
178
176
|
"open:coverage": "open-cli coverage/index.html",
|
|
179
177
|
"prepublishOnly": "npm run release:check",
|
|
180
178
|
"release:check": "npm run release:verify",
|
|
181
|
-
"release:verify": "cross-env NODE_OPTIONS= npm run build && cross-env NODE_OPTIONS= npm run lint && cross-env NODE_OPTIONS= npm run typecheck && cross-env NODE_OPTIONS= VITEST_TYPECHECK=false npm run test && cross-env NODE_OPTIONS= npm run sync:readme-rules-table && cross-env NODE_OPTIONS= npm run sync:presets-rules-matrix && cross-env NODE_OPTIONS= npm run docs:check-links && cross-env NODE_OPTIONS= npm
|
|
179
|
+
"release:verify": "cross-env NODE_OPTIONS= npm run build && cross-env NODE_OPTIONS= npm run lint:nocache && cross-env NODE_OPTIONS= npm run typecheck && cross-env NODE_OPTIONS= VITEST_TYPECHECK=false npm run test && cross-env NODE_OPTIONS= npm run sync:readme-rules-table && cross-env NODE_OPTIONS= npm run sync:presets-rules-matrix && cross-env NODE_OPTIONS= npm run docs:check-links && cross-env NODE_OPTIONS= npm run lint:package:strict",
|
|
182
180
|
"remark:fix": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail --quiet --output -- \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\"",
|
|
183
181
|
"remark:test-config": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \"README.md\"",
|
|
184
182
|
"sync:node-version-files": "node scripts/sync-node-version-files.mjs",
|
|
@@ -219,48 +217,48 @@
|
|
|
219
217
|
"jsonc-eslint-parser": "$jsonc-eslint-parser"
|
|
220
218
|
},
|
|
221
219
|
"dependencies": {
|
|
222
|
-
"@typescript-eslint/parser": "^8.58.
|
|
223
|
-
"@typescript-eslint/type-utils": "^8.58.
|
|
224
|
-
"@typescript-eslint/utils": "^8.58.
|
|
220
|
+
"@typescript-eslint/parser": "^8.58.2",
|
|
221
|
+
"@typescript-eslint/type-utils": "^8.58.2",
|
|
222
|
+
"@typescript-eslint/utils": "^8.58.2",
|
|
225
223
|
"ts-extras": "^0.19.0",
|
|
226
224
|
"type-fest": "^5.5.0"
|
|
227
225
|
},
|
|
228
226
|
"devDependencies": {
|
|
229
227
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
230
228
|
"@csstools/stylelint-formatter-github": "^2.0.0",
|
|
231
|
-
"@docusaurus/eslint-plugin": "^3.
|
|
229
|
+
"@docusaurus/eslint-plugin": "^3.10.0",
|
|
232
230
|
"@double-great/remark-lint-alt-text": "^1.1.1",
|
|
233
231
|
"@double-great/stylelint-a11y": "^3.4.9",
|
|
234
232
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
235
233
|
"@eslint-react/eslint-plugin": "^4.2.3",
|
|
236
|
-
"@eslint/config-helpers": "^0.5.
|
|
234
|
+
"@eslint/config-helpers": "^0.5.5",
|
|
237
235
|
"@eslint/config-inspector": "^1.5.0",
|
|
238
236
|
"@eslint/css": "^1.1.0",
|
|
239
237
|
"@eslint/js": "^10.0.1",
|
|
240
238
|
"@eslint/json": "^1.2.0",
|
|
241
239
|
"@eslint/markdown": "^8.0.1",
|
|
242
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
243
|
-
"@html-eslint/parser": "^0.
|
|
240
|
+
"@html-eslint/eslint-plugin": "^0.59.0",
|
|
241
|
+
"@html-eslint/parser": "^0.59.0",
|
|
244
242
|
"@microsoft/tsdoc-config": "^0.18.1",
|
|
245
|
-
"@secretlint/secretlint-rule-anthropic": "^11.
|
|
246
|
-
"@secretlint/secretlint-rule-aws": "^11.
|
|
247
|
-
"@secretlint/secretlint-rule-database-connection-string": "^11.
|
|
248
|
-
"@secretlint/secretlint-rule-gcp": "^11.
|
|
249
|
-
"@secretlint/secretlint-rule-github": "^11.
|
|
250
|
-
"@secretlint/secretlint-rule-no-dotenv": "^11.
|
|
251
|
-
"@secretlint/secretlint-rule-no-homedir": "^11.
|
|
252
|
-
"@secretlint/secretlint-rule-npm": "^11.
|
|
253
|
-
"@secretlint/secretlint-rule-openai": "^11.
|
|
254
|
-
"@secretlint/secretlint-rule-pattern": "^11.
|
|
255
|
-
"@secretlint/secretlint-rule-preset-recommend": "^11.
|
|
256
|
-
"@secretlint/secretlint-rule-privatekey": "^11.
|
|
257
|
-
"@secretlint/secretlint-rule-secp256k1-privatekey": "^11.
|
|
258
|
-
"@secretlint/types": "^11.
|
|
243
|
+
"@secretlint/secretlint-rule-anthropic": "^11.7.1",
|
|
244
|
+
"@secretlint/secretlint-rule-aws": "^11.7.1",
|
|
245
|
+
"@secretlint/secretlint-rule-database-connection-string": "^11.7.1",
|
|
246
|
+
"@secretlint/secretlint-rule-gcp": "^11.7.1",
|
|
247
|
+
"@secretlint/secretlint-rule-github": "^11.7.1",
|
|
248
|
+
"@secretlint/secretlint-rule-no-dotenv": "^11.7.1",
|
|
249
|
+
"@secretlint/secretlint-rule-no-homedir": "^11.7.1",
|
|
250
|
+
"@secretlint/secretlint-rule-npm": "^11.7.1",
|
|
251
|
+
"@secretlint/secretlint-rule-openai": "^11.7.1",
|
|
252
|
+
"@secretlint/secretlint-rule-pattern": "^11.7.1",
|
|
253
|
+
"@secretlint/secretlint-rule-preset-recommend": "^11.7.1",
|
|
254
|
+
"@secretlint/secretlint-rule-privatekey": "^11.7.1",
|
|
255
|
+
"@secretlint/secretlint-rule-secp256k1-privatekey": "^11.7.1",
|
|
256
|
+
"@secretlint/types": "^11.7.1",
|
|
259
257
|
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
|
|
260
258
|
"@stryker-ignorer/console-all": "^0.3.2",
|
|
261
|
-
"@stryker-mutator/core": "^9.6.
|
|
262
|
-
"@stryker-mutator/typescript-checker": "^9.6.
|
|
263
|
-
"@stryker-mutator/vitest-runner": "^9.6.
|
|
259
|
+
"@stryker-mutator/core": "^9.6.1",
|
|
260
|
+
"@stryker-mutator/typescript-checker": "^9.6.1",
|
|
261
|
+
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
264
262
|
"@stylelint-types/stylelint-order": "^7.0.1",
|
|
265
263
|
"@stylelint-types/stylelint-stylistic": "^5.0.0",
|
|
266
264
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
@@ -269,7 +267,7 @@
|
|
|
269
267
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
270
268
|
"@types/htmlhint": "^1.1.5",
|
|
271
269
|
"@types/madge": "^5.0.3",
|
|
272
|
-
"@types/node": "^25.
|
|
270
|
+
"@types/node": "^25.6.0",
|
|
273
271
|
"@types/postcss-clamp": "^4.1.3",
|
|
274
272
|
"@types/postcss-flexbugs-fixes": "^5.0.3",
|
|
275
273
|
"@types/postcss-html": "^1.5.3",
|
|
@@ -278,12 +276,12 @@
|
|
|
278
276
|
"@types/postcss-normalize": "^9.0.4",
|
|
279
277
|
"@types/postcss-reporter": "^7.0.5",
|
|
280
278
|
"@types/sloc": "^0.2.3",
|
|
281
|
-
"@typescript-eslint/eslint-plugin": "^8.58.
|
|
282
|
-
"@typescript-eslint/rule-tester": "^8.58.
|
|
283
|
-
"@typpi/eslint-plugin-vite": "^1.0.
|
|
284
|
-
"@vitest/coverage-v8": "^4.1.
|
|
285
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
286
|
-
"@vitest/ui": "^4.1.
|
|
279
|
+
"@typescript-eslint/eslint-plugin": "^8.58.2",
|
|
280
|
+
"@typescript-eslint/rule-tester": "^8.58.2",
|
|
281
|
+
"@typpi/eslint-plugin-vite": "^1.0.12",
|
|
282
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
283
|
+
"@vitest/eslint-plugin": "^1.6.15",
|
|
284
|
+
"@vitest/ui": "^4.1.4",
|
|
287
285
|
"actionlint": "^2.0.6",
|
|
288
286
|
"all-contributors-cli": "^6.26.1",
|
|
289
287
|
"cognitive-complexity-ts": "^0.8.1",
|
|
@@ -301,15 +299,16 @@
|
|
|
301
299
|
"eslint-plugin-canonical": "^5.1.3",
|
|
302
300
|
"eslint-plugin-case-police": "^2.2.0",
|
|
303
301
|
"eslint-plugin-comment-length": "^2.3.0",
|
|
304
|
-
"eslint-plugin-copilot": "^1.0.
|
|
302
|
+
"eslint-plugin-copilot": "^1.0.8",
|
|
305
303
|
"eslint-plugin-css-modules": "^2.12.0",
|
|
306
304
|
"eslint-plugin-de-morgan": "^2.1.1",
|
|
307
305
|
"eslint-plugin-depend": "^1.5.0",
|
|
306
|
+
"eslint-plugin-docusaurus-2": "^0.1.3",
|
|
308
307
|
"eslint-plugin-eslint-plugin": "^7.3.2",
|
|
309
|
-
"eslint-plugin-etc-misc": "^1.0.
|
|
310
|
-
"eslint-plugin-file-progress-2": "^
|
|
311
|
-
"eslint-plugin-github-actions-2": "^1.0.
|
|
312
|
-
"eslint-plugin-immutable-2": "^1.0.
|
|
308
|
+
"eslint-plugin-etc-misc": "^1.0.6",
|
|
309
|
+
"eslint-plugin-file-progress-2": "^5.0.1",
|
|
310
|
+
"eslint-plugin-github-actions-2": "^1.0.6",
|
|
311
|
+
"eslint-plugin-immutable-2": "^1.0.9",
|
|
313
312
|
"eslint-plugin-import-x": "^4.16.2",
|
|
314
313
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
315
314
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
@@ -319,7 +318,7 @@
|
|
|
319
318
|
"eslint-plugin-module-interop": "^0.3.1",
|
|
320
319
|
"eslint-plugin-n": "^17.24.0",
|
|
321
320
|
"eslint-plugin-nitpick": "^0.12.0",
|
|
322
|
-
"eslint-plugin-no-barrel-files": "^1.
|
|
321
|
+
"eslint-plugin-no-barrel-files": "^1.3.1",
|
|
323
322
|
"eslint-plugin-no-function-declare-after-return": "^1.1.0",
|
|
324
323
|
"eslint-plugin-no-lookahead-lookbehind-regexp": "^0.4.0",
|
|
325
324
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
@@ -334,35 +333,37 @@
|
|
|
334
333
|
"eslint-plugin-redos": "^4.5.0",
|
|
335
334
|
"eslint-plugin-regexp": "^3.1.0",
|
|
336
335
|
"eslint-plugin-require-jsdoc": "^1.0.4",
|
|
337
|
-
"eslint-plugin-sdl-2": "^1.0.
|
|
336
|
+
"eslint-plugin-sdl-2": "^1.0.6",
|
|
338
337
|
"eslint-plugin-security": "^4.0.0",
|
|
339
338
|
"eslint-plugin-sonarjs": "^4.0.2",
|
|
339
|
+
"eslint-plugin-stylelint-2": "^1.0.11",
|
|
340
340
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
341
341
|
"eslint-plugin-toml": "^1.3.1",
|
|
342
342
|
"eslint-plugin-tsdoc": "^0.5.2",
|
|
343
|
-
"eslint-plugin-tsdoc-require-2": "^1.0.
|
|
344
|
-
"eslint-plugin-
|
|
343
|
+
"eslint-plugin-tsdoc-require-2": "^1.0.9",
|
|
344
|
+
"eslint-plugin-typedoc": "^1.1.4",
|
|
345
|
+
"eslint-plugin-typefest": "^1.2.0",
|
|
345
346
|
"eslint-plugin-undefined-css-classes": "^0.1.5",
|
|
346
347
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
347
348
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
348
|
-
"eslint-plugin-write-good-comments-2": "^1.0.
|
|
349
|
+
"eslint-plugin-write-good-comments-2": "^1.0.6",
|
|
349
350
|
"eslint-plugin-yml": "^3.3.1",
|
|
350
351
|
"eslint-rule-benchmark": "^0.8.0",
|
|
351
352
|
"fast-check": "^4.6.0",
|
|
352
353
|
"git-cliff": "^2.12.0",
|
|
353
354
|
"gitleaks-secret-scanner": "^2.1.1",
|
|
354
|
-
"globals": "^17.
|
|
355
|
+
"globals": "^17.5.0",
|
|
355
356
|
"htmlhint": "^1.9.2",
|
|
356
|
-
"jscpd": "^4.0.
|
|
357
|
+
"jscpd": "^4.0.9",
|
|
357
358
|
"jsonc-eslint-parser": "^3.1.0",
|
|
358
|
-
"knip": "^6.
|
|
359
|
+
"knip": "^6.4.1",
|
|
359
360
|
"leasot": "^14.4.0",
|
|
360
361
|
"madge": "^8.0.0",
|
|
361
362
|
"markdown-link-check": "^3.14.2",
|
|
362
|
-
"npm-check-updates": "^
|
|
363
|
-
"npm-package-json-lint": "^10.
|
|
363
|
+
"npm-check-updates": "^21.0.0",
|
|
364
|
+
"npm-package-json-lint": "^10.2.1",
|
|
364
365
|
"picocolors": "^1.1.1",
|
|
365
|
-
"postcss": "^8.5.
|
|
366
|
+
"postcss": "^8.5.9",
|
|
366
367
|
"postcss-assets": "^6.0.0",
|
|
367
368
|
"postcss-clamp": "^4.1.0",
|
|
368
369
|
"postcss-combine-duplicated-selectors": "^10.0.3",
|
|
@@ -375,11 +376,11 @@
|
|
|
375
376
|
"postcss-reporter": "^7.1.0",
|
|
376
377
|
"postcss-round-subpixels": "^2.0.0",
|
|
377
378
|
"postcss-scss": "^4.0.9",
|
|
378
|
-
"postcss-sort-media-queries": "^6.
|
|
379
|
+
"postcss-sort-media-queries": "^6.5.0",
|
|
379
380
|
"postcss-styled-jsx": "^1.0.1",
|
|
380
381
|
"postcss-styled-syntax": "^0.7.1",
|
|
381
382
|
"postcss-viewport-height-correction": "^1.1.1",
|
|
382
|
-
"prettier": "^3.8.
|
|
383
|
+
"prettier": "^3.8.2",
|
|
383
384
|
"prettier-plugin-ini": "^1.3.0",
|
|
384
385
|
"prettier-plugin-interpolated-html-tags": "^2.0.1",
|
|
385
386
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
@@ -499,10 +500,10 @@
|
|
|
499
500
|
"remark-validate-links": "^13.1.0",
|
|
500
501
|
"remark-wiki-link": "^2.0.1",
|
|
501
502
|
"rimraf": "^6.1.3",
|
|
502
|
-
"secretlint": "^11.
|
|
503
|
+
"secretlint": "^11.7.1",
|
|
503
504
|
"sloc": "^0.3.2",
|
|
504
505
|
"sort-package-json": "^3.6.1",
|
|
505
|
-
"stylelint": "^17.
|
|
506
|
+
"stylelint": "^17.7.0",
|
|
506
507
|
"stylelint-actions-formatters": "^16.3.1",
|
|
507
508
|
"stylelint-checkstyle-formatter": "^0.1.2",
|
|
508
509
|
"stylelint-codeframe-formatter": "^1.2.0",
|
|
@@ -531,7 +532,7 @@
|
|
|
531
532
|
"stylelint-no-unresolved-module": "^2.5.2",
|
|
532
533
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
533
534
|
"stylelint-order": "^8.1.1",
|
|
534
|
-
"stylelint-plugin-defensive-css": "^2.
|
|
535
|
+
"stylelint-plugin-defensive-css": "^2.9.0",
|
|
535
536
|
"stylelint-plugin-logical-css": "^2.1.0",
|
|
536
537
|
"stylelint-plugin-use-baseline": "^1.4.1",
|
|
537
538
|
"stylelint-prettier": "^5.0.3",
|
|
@@ -542,14 +543,14 @@
|
|
|
542
543
|
"stylelint-value-no-unknown-custom-properties": "^6.1.1",
|
|
543
544
|
"toml-eslint-parser": "^1.0.3",
|
|
544
545
|
"ts-unused-exports": "^11.0.1",
|
|
545
|
-
"typedoc": "^0.28.
|
|
546
|
+
"typedoc": "^0.28.19",
|
|
546
547
|
"typescript": "^6.0.2",
|
|
547
|
-
"typescript-eslint": "^8.58.
|
|
548
|
+
"typescript-eslint": "^8.58.2",
|
|
548
549
|
"typesync": "^0.14.3",
|
|
549
550
|
"vfile": "^6.0.3",
|
|
550
|
-
"vite": "^8.0.
|
|
551
|
+
"vite": "^8.0.8",
|
|
551
552
|
"vite-tsconfig-paths": "^6.1.1",
|
|
552
|
-
"vitest": "^4.1.
|
|
553
|
+
"vitest": "^4.1.4",
|
|
553
554
|
"yaml-eslint-parser": "^2.0.0",
|
|
554
555
|
"yamllint-js": "^0.2.4"
|
|
555
556
|
},
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTypedRule } from "../_internal/typed-rule.js";
|
|
2
|
-
/**
|
|
3
|
-
* ESLint rule definition for `prefer-ts-extras-array-find-last-index`.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
7
|
-
*/
|
|
8
|
-
declare const preferTsExtrasArrayFindLastIndexRule: ReturnType<typeof createTypedRule>;
|
|
9
|
-
/**
|
|
10
|
-
* Default export for the `prefer-ts-extras-array-find-last-index` rule module.
|
|
11
|
-
*/
|
|
12
|
-
export default preferTsExtrasArrayFindLastIndexRule;
|
|
13
|
-
//# sourceMappingURL=prefer-ts-extras-array-find-last-index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find-last-index.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find-last-index.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,eAAe,EAElB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,oCAAoC,EAAE,UAAU,CAAC,OAAO,eAAe,CAmDvE,CAAC;AAEP;;GAEG;AACH,eAAe,oCAAoC,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* ESLint rule implementation for `prefer-ts-extras-array-find-last-index`.
|
|
4
|
-
*/
|
|
5
|
-
import { createIsArrayLikeExpressionChecker } from "../_internal/array-like-expression.js";
|
|
6
|
-
import { reportTsExtrasArrayMethodCall } from "../_internal/array-method-call-rule.js";
|
|
7
|
-
import { collectDirectNamedValueImportsFromSource } from "../_internal/imported-value-symbols.js";
|
|
8
|
-
import { TS_EXTRAS_MODULE_SOURCE } from "../_internal/module-source.js";
|
|
9
|
-
import { createTypedRule, getTypedRuleServices, } from "../_internal/typed-rule.js";
|
|
10
|
-
/**
|
|
11
|
-
* ESLint rule definition for `prefer-ts-extras-array-find-last-index`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
15
|
-
*/
|
|
16
|
-
const preferTsExtrasArrayFindLastIndexRule = createTypedRule({
|
|
17
|
-
create(context) {
|
|
18
|
-
const tsExtrasImports = collectDirectNamedValueImportsFromSource(context.sourceCode, TS_EXTRAS_MODULE_SOURCE);
|
|
19
|
-
const { checker, parserServices } = getTypedRuleServices(context);
|
|
20
|
-
const isArrayLikeExpression = createIsArrayLikeExpressionChecker({
|
|
21
|
-
checker,
|
|
22
|
-
parserServices,
|
|
23
|
-
telemetryFilePath: context.physicalFilename,
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
'CallExpression[callee.type="MemberExpression"][callee.computed=false][callee.property.type="Identifier"][callee.property.name="findLastIndex"]'(node) {
|
|
27
|
-
reportTsExtrasArrayMethodCall({
|
|
28
|
-
context,
|
|
29
|
-
importedName: "arrayFindLastIndex",
|
|
30
|
-
imports: tsExtrasImports,
|
|
31
|
-
isArrayLikeExpression,
|
|
32
|
-
memberName: "findLastIndex",
|
|
33
|
-
messageId: "preferTsExtrasArrayFindLastIndex",
|
|
34
|
-
node,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
meta: {
|
|
40
|
-
deprecated: false,
|
|
41
|
-
docs: {
|
|
42
|
-
description: "require ts-extras arrayFindLastIndex over Array#findLastIndex for stronger predicate inference.",
|
|
43
|
-
frozen: false,
|
|
44
|
-
recommended: false,
|
|
45
|
-
requiresTypeChecking: true,
|
|
46
|
-
typefestConfigs: "typefest.configs.all",
|
|
47
|
-
url: "https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find-last-index",
|
|
48
|
-
},
|
|
49
|
-
fixable: "code",
|
|
50
|
-
messages: {
|
|
51
|
-
preferTsExtrasArrayFindLastIndex: "Prefer `arrayFindLastIndex` from `ts-extras` over `array.findLastIndex(...)` for stronger predicate inference.",
|
|
52
|
-
},
|
|
53
|
-
schema: [],
|
|
54
|
-
type: "suggestion",
|
|
55
|
-
},
|
|
56
|
-
name: "prefer-ts-extras-array-find-last-index",
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Default export for the `prefer-ts-extras-array-find-last-index` rule module.
|
|
60
|
-
*/
|
|
61
|
-
export default preferTsExtrasArrayFindLastIndexRule;
|
|
62
|
-
//# sourceMappingURL=prefer-ts-extras-array-find-last-index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find-last-index.js","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find-last-index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,wCAAwC,EAAE,MAAM,wCAAwC,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EACH,eAAe,EACf,oBAAoB,GACvB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,oCAAoC,GACtC,eAAe,CAAC;IACZ,MAAM,CAAC,OAAO;QACV,MAAM,eAAe,GAAG,wCAAwC,CAC5D,OAAO,CAAC,UAAU,EAClB,uBAAuB,CAC1B,CAAC;QAEF,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAClE,MAAM,qBAAqB,GAAG,kCAAkC,CAAC;YAC7D,OAAO;YACP,cAAc;YACd,iBAAiB,EAAE,OAAO,CAAC,gBAAgB;SAC9C,CAAC,CAAC;QAEH,OAAO;YACH,gJAAgJ,CAC5I,IAAI;gBAEJ,6BAA6B,CAAC;oBAC1B,OAAO;oBACP,YAAY,EAAE,oBAAoB;oBAClC,OAAO,EAAE,eAAe;oBACxB,qBAAqB;oBACrB,UAAU,EAAE,eAAe;oBAC3B,SAAS,EAAE,kCAAkC;oBAC7C,IAAI;iBACP,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;IACD,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,WAAW,EACP,iGAAiG;YACrG,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,sBAAsB;YACvC,GAAG,EAAE,uGAAuG;SAC/G;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACN,gCAAgC,EAC5B,gHAAgH;SACvH;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,wCAAwC;CACjD,CAAC,CAAC;AAEP;;GAEG;AACH,eAAe,oCAAoC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTypedRule } from "../_internal/typed-rule.js";
|
|
2
|
-
/**
|
|
3
|
-
* ESLint rule definition for `prefer-ts-extras-array-find-last`.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
7
|
-
*/
|
|
8
|
-
declare const preferTsExtrasArrayFindLastRule: ReturnType<typeof createTypedRule>;
|
|
9
|
-
/**
|
|
10
|
-
* Default export for the `prefer-ts-extras-array-find-last` rule module.
|
|
11
|
-
*/
|
|
12
|
-
export default preferTsExtrasArrayFindLastRule;
|
|
13
|
-
//# sourceMappingURL=prefer-ts-extras-array-find-last.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find-last.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find-last.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,eAAe,EAElB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,+BAA+B,EAAE,UAAU,CAAC,OAAO,eAAe,CAsDlE,CAAC;AAEP;;GAEG;AACH,eAAe,+BAA+B,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* ESLint rule implementation for `prefer-ts-extras-array-find-last`.
|
|
4
|
-
*/
|
|
5
|
-
import { createIsArrayLikeExpressionChecker } from "../_internal/array-like-expression.js";
|
|
6
|
-
import { reportTsExtrasArrayMethodCall } from "../_internal/array-method-call-rule.js";
|
|
7
|
-
import { collectDirectNamedValueImportsFromSource } from "../_internal/imported-value-symbols.js";
|
|
8
|
-
import { TS_EXTRAS_MODULE_SOURCE } from "../_internal/module-source.js";
|
|
9
|
-
import { createTypedRule, getTypedRuleServices, } from "../_internal/typed-rule.js";
|
|
10
|
-
/**
|
|
11
|
-
* ESLint rule definition for `prefer-ts-extras-array-find-last`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
15
|
-
*/
|
|
16
|
-
const preferTsExtrasArrayFindLastRule = createTypedRule({
|
|
17
|
-
create(context) {
|
|
18
|
-
const tsExtrasImports = collectDirectNamedValueImportsFromSource(context.sourceCode, TS_EXTRAS_MODULE_SOURCE);
|
|
19
|
-
const { checker, parserServices } = getTypedRuleServices(context);
|
|
20
|
-
const isArrayLikeExpression = createIsArrayLikeExpressionChecker({
|
|
21
|
-
checker,
|
|
22
|
-
parserServices,
|
|
23
|
-
telemetryFilePath: context.physicalFilename,
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
'CallExpression[callee.type="MemberExpression"][callee.computed=false][callee.property.type="Identifier"][callee.property.name="findLast"]'(node) {
|
|
27
|
-
reportTsExtrasArrayMethodCall({
|
|
28
|
-
context,
|
|
29
|
-
importedName: "arrayFindLast",
|
|
30
|
-
imports: tsExtrasImports,
|
|
31
|
-
isArrayLikeExpression,
|
|
32
|
-
memberName: "findLast",
|
|
33
|
-
messageId: "preferTsExtrasArrayFindLast",
|
|
34
|
-
node,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
meta: {
|
|
40
|
-
deprecated: false,
|
|
41
|
-
docs: {
|
|
42
|
-
description: "require ts-extras arrayFindLast over Array#findLast for stronger predicate inference.",
|
|
43
|
-
frozen: false,
|
|
44
|
-
recommended: false,
|
|
45
|
-
requiresTypeChecking: true,
|
|
46
|
-
typefestConfigs: [
|
|
47
|
-
"typefest.configs.strict",
|
|
48
|
-
"typefest.configs.all",
|
|
49
|
-
],
|
|
50
|
-
url: "https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find-last",
|
|
51
|
-
},
|
|
52
|
-
fixable: "code",
|
|
53
|
-
messages: {
|
|
54
|
-
preferTsExtrasArrayFindLast: "Prefer `arrayFindLast` from `ts-extras` over `array.findLast(...)` for stronger predicate inference.",
|
|
55
|
-
},
|
|
56
|
-
schema: [],
|
|
57
|
-
type: "suggestion",
|
|
58
|
-
},
|
|
59
|
-
name: "prefer-ts-extras-array-find-last",
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* Default export for the `prefer-ts-extras-array-find-last` rule module.
|
|
63
|
-
*/
|
|
64
|
-
export default preferTsExtrasArrayFindLastRule;
|
|
65
|
-
//# sourceMappingURL=prefer-ts-extras-array-find-last.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find-last.js","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find-last.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,wCAAwC,EAAE,MAAM,wCAAwC,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EACH,eAAe,EACf,oBAAoB,GACvB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,+BAA+B,GACjC,eAAe,CAAC;IACZ,MAAM,CAAC,OAAO;QACV,MAAM,eAAe,GAAG,wCAAwC,CAC5D,OAAO,CAAC,UAAU,EAClB,uBAAuB,CAC1B,CAAC;QAEF,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAClE,MAAM,qBAAqB,GAAG,kCAAkC,CAAC;YAC7D,OAAO;YACP,cAAc;YACd,iBAAiB,EAAE,OAAO,CAAC,gBAAgB;SAC9C,CAAC,CAAC;QAEH,OAAO;YACH,2IAA2I,CACvI,IAAI;gBAEJ,6BAA6B,CAAC;oBAC1B,OAAO;oBACP,YAAY,EAAE,eAAe;oBAC7B,OAAO,EAAE,eAAe;oBACxB,qBAAqB;oBACrB,UAAU,EAAE,UAAU;oBACtB,SAAS,EAAE,6BAA6B;oBACxC,IAAI;iBACP,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;IACD,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,WAAW,EACP,uFAAuF;YAC3F,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE;gBACb,yBAAyB;gBACzB,sBAAsB;aACzB;YACD,GAAG,EAAE,iGAAiG;SACzG;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACN,2BAA2B,EACvB,sGAAsG;SAC7G;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,kCAAkC;CAC3C,CAAC,CAAC;AAEP;;GAEG;AACH,eAAe,+BAA+B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createTypedRule } from "../_internal/typed-rule.js";
|
|
2
|
-
/**
|
|
3
|
-
* ESLint rule definition for `prefer-ts-extras-array-find`.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
7
|
-
*/
|
|
8
|
-
declare const preferTsExtrasArrayFindRule: ReturnType<typeof createTypedRule>;
|
|
9
|
-
/**
|
|
10
|
-
* Default export for the `prefer-ts-extras-array-find` rule module.
|
|
11
|
-
*/
|
|
12
|
-
export default preferTsExtrasArrayFindRule;
|
|
13
|
-
//# sourceMappingURL=prefer-ts-extras-array-find.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,eAAe,EAElB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,2BAA2B,EAAE,UAAU,CAAC,OAAO,eAAe,CAmD9D,CAAC;AAEP;;GAEG;AACH,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* ESLint rule implementation for `prefer-ts-extras-array-find`.
|
|
4
|
-
*/
|
|
5
|
-
import { createIsArrayLikeExpressionChecker } from "../_internal/array-like-expression.js";
|
|
6
|
-
import { reportTsExtrasArrayMethodCall } from "../_internal/array-method-call-rule.js";
|
|
7
|
-
import { collectDirectNamedValueImportsFromSource } from "../_internal/imported-value-symbols.js";
|
|
8
|
-
import { TS_EXTRAS_MODULE_SOURCE } from "../_internal/module-source.js";
|
|
9
|
-
import { createTypedRule, getTypedRuleServices, } from "../_internal/typed-rule.js";
|
|
10
|
-
/**
|
|
11
|
-
* ESLint rule definition for `prefer-ts-extras-array-find`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Defines metadata, diagnostics, and suggestions/fixes for this rule.
|
|
15
|
-
*/
|
|
16
|
-
const preferTsExtrasArrayFindRule = createTypedRule({
|
|
17
|
-
create(context) {
|
|
18
|
-
const tsExtrasImports = collectDirectNamedValueImportsFromSource(context.sourceCode, TS_EXTRAS_MODULE_SOURCE);
|
|
19
|
-
const { checker, parserServices } = getTypedRuleServices(context);
|
|
20
|
-
const isArrayLikeExpression = createIsArrayLikeExpressionChecker({
|
|
21
|
-
checker,
|
|
22
|
-
parserServices,
|
|
23
|
-
telemetryFilePath: context.physicalFilename,
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
'CallExpression[callee.type="MemberExpression"][callee.computed=false][callee.property.type="Identifier"][callee.property.name="find"]'(node) {
|
|
27
|
-
reportTsExtrasArrayMethodCall({
|
|
28
|
-
context,
|
|
29
|
-
importedName: "arrayFind",
|
|
30
|
-
imports: tsExtrasImports,
|
|
31
|
-
isArrayLikeExpression,
|
|
32
|
-
memberName: "find",
|
|
33
|
-
messageId: "preferTsExtrasArrayFind",
|
|
34
|
-
node,
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
meta: {
|
|
40
|
-
deprecated: false,
|
|
41
|
-
docs: {
|
|
42
|
-
description: "require ts-extras arrayFind over Array#find for stronger predicate inference.",
|
|
43
|
-
frozen: false,
|
|
44
|
-
recommended: false,
|
|
45
|
-
requiresTypeChecking: true,
|
|
46
|
-
typefestConfigs: "typefest.configs.all",
|
|
47
|
-
url: "https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find",
|
|
48
|
-
},
|
|
49
|
-
fixable: "code",
|
|
50
|
-
messages: {
|
|
51
|
-
preferTsExtrasArrayFind: "Prefer `arrayFind` from `ts-extras` over `array.find(...)` for stronger predicate inference.",
|
|
52
|
-
},
|
|
53
|
-
schema: [],
|
|
54
|
-
type: "suggestion",
|
|
55
|
-
},
|
|
56
|
-
name: "prefer-ts-extras-array-find",
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* Default export for the `prefer-ts-extras-array-find` rule module.
|
|
60
|
-
*/
|
|
61
|
-
export default preferTsExtrasArrayFindRule;
|
|
62
|
-
//# sourceMappingURL=prefer-ts-extras-array-find.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-ts-extras-array-find.js","sourceRoot":"","sources":["../../src/rules/prefer-ts-extras-array-find.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,wCAAwC,EAAE,MAAM,wCAAwC,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EACH,eAAe,EACf,oBAAoB,GACvB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,2BAA2B,GAC7B,eAAe,CAAC;IACZ,MAAM,CAAC,OAAO;QACV,MAAM,eAAe,GAAG,wCAAwC,CAC5D,OAAO,CAAC,UAAU,EAClB,uBAAuB,CAC1B,CAAC;QAEF,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAClE,MAAM,qBAAqB,GAAG,kCAAkC,CAAC;YAC7D,OAAO;YACP,cAAc;YACd,iBAAiB,EAAE,OAAO,CAAC,gBAAgB;SAC9C,CAAC,CAAC;QAEH,OAAO;YACH,uIAAuI,CACnI,IAAI;gBAEJ,6BAA6B,CAAC;oBAC1B,OAAO;oBACP,YAAY,EAAE,WAAW;oBACzB,OAAO,EAAE,eAAe;oBACxB,qBAAqB;oBACrB,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE,yBAAyB;oBACpC,IAAI;iBACP,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;IACD,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,WAAW,EACP,+EAA+E;YACnF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,sBAAsB;YACvC,GAAG,EAAE,4FAA4F;SACpG;QACD,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE;YACN,uBAAuB,EACnB,8FAA8F;SACrG;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,6BAA6B;CACtC,CAAC,CAAC;AAEP;;GAEG;AACH,eAAe,2BAA2B,CAAC"}
|