eslint-plugin-typefest 1.0.10 → 1.2.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 +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 +69 -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 +67 -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.0
|
|
4
|
+
"version": "1.2.0",
|
|
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,8 +140,8 @@
|
|
|
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",
|
|
@@ -154,7 +151,7 @@
|
|
|
154
151
|
"lint:node-version-files": "node scripts/sync-node-version-files.mjs --check",
|
|
155
152
|
"lint:orphans": "npm run madge:orphans",
|
|
156
153
|
"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!\"",
|
|
154
|
+
"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
155
|
"lint:package-check": "publint && attw --pack .",
|
|
159
156
|
"lint:package-check:strict": "publint && attw --pack . --profile strict",
|
|
160
157
|
"lint:package-sort": "sort-package-json \"./package.json\" \"./docs/docusaurus/package.json\"",
|
|
@@ -163,7 +160,7 @@
|
|
|
163
160
|
"lint:prettier": "prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --check",
|
|
164
161
|
"lint:prettier:fix": "prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --write",
|
|
165
162
|
"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!\"",
|
|
163
|
+
"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
164
|
"lint:remark": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\" --quiet",
|
|
168
165
|
"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
166
|
"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 +175,7 @@
|
|
|
178
175
|
"open:coverage": "open-cli coverage/index.html",
|
|
179
176
|
"prepublishOnly": "npm run release:check",
|
|
180
177
|
"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
|
|
178
|
+
"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 run lint:package:strict",
|
|
182
179
|
"remark:fix": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail --quiet --output -- \"*.{md,mdx}\" \"docs/**/*.{md,mdx}\"",
|
|
183
180
|
"remark:test-config": "remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \"README.md\"",
|
|
184
181
|
"sync:node-version-files": "node scripts/sync-node-version-files.mjs",
|
|
@@ -219,48 +216,48 @@
|
|
|
219
216
|
"jsonc-eslint-parser": "$jsonc-eslint-parser"
|
|
220
217
|
},
|
|
221
218
|
"dependencies": {
|
|
222
|
-
"@typescript-eslint/parser": "^8.58.
|
|
223
|
-
"@typescript-eslint/type-utils": "^8.58.
|
|
224
|
-
"@typescript-eslint/utils": "^8.58.
|
|
219
|
+
"@typescript-eslint/parser": "^8.58.2",
|
|
220
|
+
"@typescript-eslint/type-utils": "^8.58.2",
|
|
221
|
+
"@typescript-eslint/utils": "^8.58.2",
|
|
225
222
|
"ts-extras": "^0.19.0",
|
|
226
223
|
"type-fest": "^5.5.0"
|
|
227
224
|
},
|
|
228
225
|
"devDependencies": {
|
|
229
226
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
230
227
|
"@csstools/stylelint-formatter-github": "^2.0.0",
|
|
231
|
-
"@docusaurus/eslint-plugin": "^3.
|
|
228
|
+
"@docusaurus/eslint-plugin": "^3.10.0",
|
|
232
229
|
"@double-great/remark-lint-alt-text": "^1.1.1",
|
|
233
230
|
"@double-great/stylelint-a11y": "^3.4.9",
|
|
234
231
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
235
232
|
"@eslint-react/eslint-plugin": "^4.2.3",
|
|
236
|
-
"@eslint/config-helpers": "^0.5.
|
|
233
|
+
"@eslint/config-helpers": "^0.5.5",
|
|
237
234
|
"@eslint/config-inspector": "^1.5.0",
|
|
238
235
|
"@eslint/css": "^1.1.0",
|
|
239
236
|
"@eslint/js": "^10.0.1",
|
|
240
237
|
"@eslint/json": "^1.2.0",
|
|
241
238
|
"@eslint/markdown": "^8.0.1",
|
|
242
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
243
|
-
"@html-eslint/parser": "^0.
|
|
239
|
+
"@html-eslint/eslint-plugin": "^0.59.0",
|
|
240
|
+
"@html-eslint/parser": "^0.59.0",
|
|
244
241
|
"@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.
|
|
242
|
+
"@secretlint/secretlint-rule-anthropic": "^11.7.1",
|
|
243
|
+
"@secretlint/secretlint-rule-aws": "^11.7.1",
|
|
244
|
+
"@secretlint/secretlint-rule-database-connection-string": "^11.7.1",
|
|
245
|
+
"@secretlint/secretlint-rule-gcp": "^11.7.1",
|
|
246
|
+
"@secretlint/secretlint-rule-github": "^11.7.1",
|
|
247
|
+
"@secretlint/secretlint-rule-no-dotenv": "^11.7.1",
|
|
248
|
+
"@secretlint/secretlint-rule-no-homedir": "^11.7.1",
|
|
249
|
+
"@secretlint/secretlint-rule-npm": "^11.7.1",
|
|
250
|
+
"@secretlint/secretlint-rule-openai": "^11.7.1",
|
|
251
|
+
"@secretlint/secretlint-rule-pattern": "^11.7.1",
|
|
252
|
+
"@secretlint/secretlint-rule-preset-recommend": "^11.7.1",
|
|
253
|
+
"@secretlint/secretlint-rule-privatekey": "^11.7.1",
|
|
254
|
+
"@secretlint/secretlint-rule-secp256k1-privatekey": "^11.7.1",
|
|
255
|
+
"@secretlint/types": "^11.7.1",
|
|
259
256
|
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
|
|
260
257
|
"@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.
|
|
258
|
+
"@stryker-mutator/core": "^9.6.1",
|
|
259
|
+
"@stryker-mutator/typescript-checker": "^9.6.1",
|
|
260
|
+
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
264
261
|
"@stylelint-types/stylelint-order": "^7.0.1",
|
|
265
262
|
"@stylelint-types/stylelint-stylistic": "^5.0.0",
|
|
266
263
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
@@ -269,7 +266,7 @@
|
|
|
269
266
|
"@types/eslint-plugin-security": "^3.0.1",
|
|
270
267
|
"@types/htmlhint": "^1.1.5",
|
|
271
268
|
"@types/madge": "^5.0.3",
|
|
272
|
-
"@types/node": "^25.
|
|
269
|
+
"@types/node": "^25.6.0",
|
|
273
270
|
"@types/postcss-clamp": "^4.1.3",
|
|
274
271
|
"@types/postcss-flexbugs-fixes": "^5.0.3",
|
|
275
272
|
"@types/postcss-html": "^1.5.3",
|
|
@@ -278,12 +275,12 @@
|
|
|
278
275
|
"@types/postcss-normalize": "^9.0.4",
|
|
279
276
|
"@types/postcss-reporter": "^7.0.5",
|
|
280
277
|
"@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.
|
|
278
|
+
"@typescript-eslint/eslint-plugin": "^8.58.2",
|
|
279
|
+
"@typescript-eslint/rule-tester": "^8.58.2",
|
|
280
|
+
"@typpi/eslint-plugin-vite": "^1.0.12",
|
|
281
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
282
|
+
"@vitest/eslint-plugin": "^1.6.15",
|
|
283
|
+
"@vitest/ui": "^4.1.4",
|
|
287
284
|
"actionlint": "^2.0.6",
|
|
288
285
|
"all-contributors-cli": "^6.26.1",
|
|
289
286
|
"cognitive-complexity-ts": "^0.8.1",
|
|
@@ -301,15 +298,16 @@
|
|
|
301
298
|
"eslint-plugin-canonical": "^5.1.3",
|
|
302
299
|
"eslint-plugin-case-police": "^2.2.0",
|
|
303
300
|
"eslint-plugin-comment-length": "^2.3.0",
|
|
304
|
-
"eslint-plugin-copilot": "^1.0.
|
|
301
|
+
"eslint-plugin-copilot": "^1.0.8",
|
|
305
302
|
"eslint-plugin-css-modules": "^2.12.0",
|
|
306
303
|
"eslint-plugin-de-morgan": "^2.1.1",
|
|
307
304
|
"eslint-plugin-depend": "^1.5.0",
|
|
305
|
+
"eslint-plugin-docusaurus-2": "^0.1.3",
|
|
308
306
|
"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.
|
|
307
|
+
"eslint-plugin-etc-misc": "^1.0.6",
|
|
308
|
+
"eslint-plugin-file-progress-2": "^5.0.1",
|
|
309
|
+
"eslint-plugin-github-actions-2": "^1.0.6",
|
|
310
|
+
"eslint-plugin-immutable-2": "^1.0.9",
|
|
313
311
|
"eslint-plugin-import-x": "^4.16.2",
|
|
314
312
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
315
313
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
@@ -319,7 +317,7 @@
|
|
|
319
317
|
"eslint-plugin-module-interop": "^0.3.1",
|
|
320
318
|
"eslint-plugin-n": "^17.24.0",
|
|
321
319
|
"eslint-plugin-nitpick": "^0.12.0",
|
|
322
|
-
"eslint-plugin-no-barrel-files": "^1.
|
|
320
|
+
"eslint-plugin-no-barrel-files": "^1.3.1",
|
|
323
321
|
"eslint-plugin-no-function-declare-after-return": "^1.1.0",
|
|
324
322
|
"eslint-plugin-no-lookahead-lookbehind-regexp": "^0.4.0",
|
|
325
323
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
@@ -334,35 +332,37 @@
|
|
|
334
332
|
"eslint-plugin-redos": "^4.5.0",
|
|
335
333
|
"eslint-plugin-regexp": "^3.1.0",
|
|
336
334
|
"eslint-plugin-require-jsdoc": "^1.0.4",
|
|
337
|
-
"eslint-plugin-sdl-2": "^1.0.
|
|
335
|
+
"eslint-plugin-sdl-2": "^1.0.6",
|
|
338
336
|
"eslint-plugin-security": "^4.0.0",
|
|
339
337
|
"eslint-plugin-sonarjs": "^4.0.2",
|
|
338
|
+
"eslint-plugin-stylelint-2": "^1.0.10",
|
|
340
339
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
341
340
|
"eslint-plugin-toml": "^1.3.1",
|
|
342
341
|
"eslint-plugin-tsdoc": "^0.5.2",
|
|
343
|
-
"eslint-plugin-tsdoc-require-2": "^1.0.
|
|
344
|
-
"eslint-plugin-
|
|
342
|
+
"eslint-plugin-tsdoc-require-2": "^1.0.9",
|
|
343
|
+
"eslint-plugin-typedoc": "^1.1.4",
|
|
344
|
+
"eslint-plugin-typefest": "^1.0.10",
|
|
345
345
|
"eslint-plugin-undefined-css-classes": "^0.1.5",
|
|
346
346
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
347
347
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
348
|
-
"eslint-plugin-write-good-comments-2": "^1.0.
|
|
348
|
+
"eslint-plugin-write-good-comments-2": "^1.0.6",
|
|
349
349
|
"eslint-plugin-yml": "^3.3.1",
|
|
350
350
|
"eslint-rule-benchmark": "^0.8.0",
|
|
351
351
|
"fast-check": "^4.6.0",
|
|
352
352
|
"git-cliff": "^2.12.0",
|
|
353
353
|
"gitleaks-secret-scanner": "^2.1.1",
|
|
354
|
-
"globals": "^17.
|
|
354
|
+
"globals": "^17.5.0",
|
|
355
355
|
"htmlhint": "^1.9.2",
|
|
356
|
-
"jscpd": "^4.0.
|
|
356
|
+
"jscpd": "^4.0.9",
|
|
357
357
|
"jsonc-eslint-parser": "^3.1.0",
|
|
358
|
-
"knip": "^6.
|
|
358
|
+
"knip": "^6.4.1",
|
|
359
359
|
"leasot": "^14.4.0",
|
|
360
360
|
"madge": "^8.0.0",
|
|
361
361
|
"markdown-link-check": "^3.14.2",
|
|
362
|
-
"npm-check-updates": "^20.0.
|
|
363
|
-
"npm-package-json-lint": "^10.
|
|
362
|
+
"npm-check-updates": "^20.0.2",
|
|
363
|
+
"npm-package-json-lint": "^10.2.1",
|
|
364
364
|
"picocolors": "^1.1.1",
|
|
365
|
-
"postcss": "^8.5.
|
|
365
|
+
"postcss": "^8.5.9",
|
|
366
366
|
"postcss-assets": "^6.0.0",
|
|
367
367
|
"postcss-clamp": "^4.1.0",
|
|
368
368
|
"postcss-combine-duplicated-selectors": "^10.0.3",
|
|
@@ -375,11 +375,11 @@
|
|
|
375
375
|
"postcss-reporter": "^7.1.0",
|
|
376
376
|
"postcss-round-subpixels": "^2.0.0",
|
|
377
377
|
"postcss-scss": "^4.0.9",
|
|
378
|
-
"postcss-sort-media-queries": "^6.
|
|
378
|
+
"postcss-sort-media-queries": "^6.5.0",
|
|
379
379
|
"postcss-styled-jsx": "^1.0.1",
|
|
380
380
|
"postcss-styled-syntax": "^0.7.1",
|
|
381
381
|
"postcss-viewport-height-correction": "^1.1.1",
|
|
382
|
-
"prettier": "^3.8.
|
|
382
|
+
"prettier": "^3.8.2",
|
|
383
383
|
"prettier-plugin-ini": "^1.3.0",
|
|
384
384
|
"prettier-plugin-interpolated-html-tags": "^2.0.1",
|
|
385
385
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
@@ -499,10 +499,10 @@
|
|
|
499
499
|
"remark-validate-links": "^13.1.0",
|
|
500
500
|
"remark-wiki-link": "^2.0.1",
|
|
501
501
|
"rimraf": "^6.1.3",
|
|
502
|
-
"secretlint": "^11.
|
|
502
|
+
"secretlint": "^11.7.1",
|
|
503
503
|
"sloc": "^0.3.2",
|
|
504
504
|
"sort-package-json": "^3.6.1",
|
|
505
|
-
"stylelint": "^17.
|
|
505
|
+
"stylelint": "^17.7.0",
|
|
506
506
|
"stylelint-actions-formatters": "^16.3.1",
|
|
507
507
|
"stylelint-checkstyle-formatter": "^0.1.2",
|
|
508
508
|
"stylelint-codeframe-formatter": "^1.2.0",
|
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
"stylelint-no-unresolved-module": "^2.5.2",
|
|
532
532
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
533
533
|
"stylelint-order": "^8.1.1",
|
|
534
|
-
"stylelint-plugin-defensive-css": "^2.
|
|
534
|
+
"stylelint-plugin-defensive-css": "^2.9.0",
|
|
535
535
|
"stylelint-plugin-logical-css": "^2.1.0",
|
|
536
536
|
"stylelint-plugin-use-baseline": "^1.4.1",
|
|
537
537
|
"stylelint-prettier": "^5.0.3",
|
|
@@ -542,14 +542,14 @@
|
|
|
542
542
|
"stylelint-value-no-unknown-custom-properties": "^6.1.1",
|
|
543
543
|
"toml-eslint-parser": "^1.0.3",
|
|
544
544
|
"ts-unused-exports": "^11.0.1",
|
|
545
|
-
"typedoc": "^0.28.
|
|
545
|
+
"typedoc": "^0.28.19",
|
|
546
546
|
"typescript": "^6.0.2",
|
|
547
|
-
"typescript-eslint": "^8.58.
|
|
547
|
+
"typescript-eslint": "^8.58.2",
|
|
548
548
|
"typesync": "^0.14.3",
|
|
549
549
|
"vfile": "^6.0.3",
|
|
550
|
-
"vite": "^8.0.
|
|
550
|
+
"vite": "^8.0.8",
|
|
551
551
|
"vite-tsconfig-paths": "^6.1.1",
|
|
552
|
-
"vitest": "^4.1.
|
|
552
|
+
"vitest": "^4.1.4",
|
|
553
553
|
"yaml-eslint-parser": "^2.0.0",
|
|
554
554
|
"yamllint-js": "^0.2.4"
|
|
555
555
|
},
|
|
@@ -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"}
|