This commit is contained in:
Alex 2024-11-09 21:39:15 -05:00
parent a1ab2ad7f5
commit 97eb90f6c6
8 changed files with 56 additions and 38 deletions

16
dist/package.json vendored
View File

@ -1,6 +1,6 @@
{ {
"name": "@aet/eslint-rules", "name": "@aet/eslint-rules",
"version": "2.0.4", "version": "2.0.6",
"license": "UNLICENSED", "license": "UNLICENSED",
"type": "module", "type": "module",
"bin": { "bin": {
@ -18,16 +18,16 @@
"dependencies": { "dependencies": {
"@antfu/install-pkg": "^0.4.1", "@antfu/install-pkg": "^0.4.1",
"@nolyfill/is-core-module": "^1.0.39", "@nolyfill/is-core-module": "^1.0.39",
"@aet/eslint-define-config": "^0.1.0-beta.32", "@aet/eslint-define-config": "^0.1.0-beta.33",
"@eslint/js": "^9.14.0", "@eslint/js": "^9.14.0",
"@eslint-community/eslint-utils": "^4.4.1", "@eslint-community/eslint-utils": "^4.4.1",
"@types/eslint": "^9.6.1", "@types/eslint": "^9.6.1",
"@typescript-eslint/eslint-plugin": "^8.12.2", "@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.12.2", "@typescript-eslint/parser": "^8.13.0",
"@eslint-react/eslint-plugin": "1.15.2", "@eslint-react/eslint-plugin": "1.15.2",
"@stylistic/eslint-plugin": "^2.10.1", "@stylistic/eslint-plugin": "^2.10.1",
"@typescript-eslint/type-utils": "^8.12.2", "@typescript-eslint/type-utils": "^8.13.0",
"@typescript-eslint/utils": "^8.12.2", "@typescript-eslint/utils": "^8.13.0",
"aria-query": "^5.3.2", "aria-query": "^5.3.2",
"axe-core": "^4.10.2", "axe-core": "^4.10.2",
"axobject-query": "4.1.0", "axobject-query": "4.1.0",
@ -36,7 +36,7 @@
"doctrine": "^3.0.0", "doctrine": "^3.0.0",
"emoji-regex": "^10.4.0", "emoji-regex": "^10.4.0",
"enhanced-resolve": "^5.17.1", "enhanced-resolve": "^5.17.1",
"typescript-eslint": "^8.12.2", "typescript-eslint": "^8.13.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9", "eslint-import-resolver-node": "^0.3.9",
"eslint-import-resolver-typescript": "^3.6.3", "eslint-import-resolver-typescript": "^3.6.3",
@ -48,7 +48,7 @@
"estraverse": "^5.3.0", "estraverse": "^5.3.0",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"get-tsconfig": "^4.8.1", "get-tsconfig": "^4.8.1",
"globals": "^15.11.0", "globals": "^15.12.0",
"ignore": "^6.0.2", "ignore": "^6.0.2",
"is-bun-module": "^1.2.1", "is-bun-module": "^1.2.1",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",

View File

@ -10,7 +10,7 @@
}, },
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@aet/eslint-define-config": "^0.1.0-beta.32", "@aet/eslint-define-config": "^0.1.0-beta.33",
"@antfu/install-pkg": "^0.4.1", "@antfu/install-pkg": "^0.4.1",
"@babel/core": "^7.26.0", "@babel/core": "^7.26.0",
"@babel/plugin-transform-flow-strip-types": "^7.25.9", "@babel/plugin-transform-flow-strip-types": "^7.25.9",
@ -20,7 +20,7 @@
"@graphql-eslint/eslint-plugin": "^3.20.1", "@graphql-eslint/eslint-plugin": "^3.20.1",
"@stylistic/eslint-plugin": "^2.10.1", "@stylistic/eslint-plugin": "^2.10.1",
"@swc-node/register": "^1.10.9", "@swc-node/register": "^1.10.9",
"@tanstack/eslint-plugin-query": "^5.59.7", "@tanstack/eslint-plugin-query": "^5.60.1",
"@types/babel-plugin-macros": "^3.1.3", "@types/babel-plugin-macros": "^3.1.3",
"@types/babel__core": "^7.20.5", "@types/babel__core": "^7.20.5",
"@types/eslint": "^9.6.1", "@types/eslint": "^9.6.1",
@ -32,19 +32,19 @@
"@types/estree": "^1.0.6", "@types/estree": "^1.0.6",
"@types/estree-jsx": "^1.0.5", "@types/estree-jsx": "^1.0.5",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/node": "^22.8.6", "@types/node": "^22.9.0",
"@types/react-refresh": "^0.14.6", "@types/react-refresh": "^0.14.6",
"@typescript-eslint/eslint-plugin": "^8.12.2", "@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.12.2", "@typescript-eslint/parser": "^8.13.0",
"@typescript-eslint/type-utils": "^8.12.2", "@typescript-eslint/type-utils": "^8.13.0",
"@typescript-eslint/types": "^8.12.2", "@typescript-eslint/types": "^8.13.0",
"@typescript-eslint/typescript-estree": "^8.12.2", "@typescript-eslint/typescript-estree": "^8.13.0",
"@typescript-eslint/utils": "^8.12.2", "@typescript-eslint/utils": "^8.13.0",
"babel-plugin-macros": "^3.1.0", "babel-plugin-macros": "^3.1.0",
"dts-bundle-generator": "9.5.1", "dts-bundle-generator": "9.5.1",
"esbuild": "0.24.0", "esbuild": "0.24.0",
"esbuild-plugin-alias": "^0.2.1", "esbuild-plugin-alias": "^0.2.1",
"eslint": "9.13.0", "eslint": "9.14.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3", "eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import-x": "^4.4.0", "eslint-plugin-import-x": "^4.4.0",
@ -58,7 +58,7 @@
"esquery": "^1.6.0", "esquery": "^1.6.0",
"fast-glob": "^3.3.2", "fast-glob": "^3.3.2",
"find-cache-dir": "^5.0.0", "find-cache-dir": "^5.0.0",
"globals": "^15.11.0", "globals": "^15.12.0",
"graphql": "^16.9.0", "graphql": "^16.9.0",
"json-schema-to-ts": "^3.1.1", "json-schema-to-ts": "^3.1.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
@ -70,7 +70,7 @@
"terser": "^5.36.0", "terser": "^5.36.0",
"type-fest": "^4.26.1", "type-fest": "^4.26.1",
"typescript": "^5.6.3", "typescript": "^5.6.3",
"typescript-eslint": "^8.12.2" "typescript-eslint": "^8.13.0"
}, },
"prettier": { "prettier": {
"arrowParens": "avoid", "arrowParens": "avoid",

View File

@ -205,8 +205,21 @@ index df7b6b8..c4d0da1 100644
nodeName: 'input', nodeName: 'input',
attributes: { attributes: {
autocomplete, autocomplete,
diff --git a/src/rules/label-has-associated-control.js b/src/rules/label-has-associated-control.js
index dd6b199..184199e 100644
--- a/src/rules/label-has-associated-control.js
+++ b/src/rules/label-has-associated-control.js
@@ -11,7 +11,7 @@
import { hasProp, getProp, getPropValue } from 'jsx-ast-utils';
import type { JSXElement } from 'ast-types-flow';
-import minimatch from 'minimatch';
+import { minimatch } from 'minimatch';
import { generateObjSchema, arraySchema } from '../util/schemas';
import type { ESLintConfig, ESLintContext, ESLintVisitorSelectorConfig } from '../../flow/eslint';
import getElementType from '../util/getElementType';
diff --git a/src/util/mayContainChildComponent.js b/src/util/mayContainChildComponent.js diff --git a/src/util/mayContainChildComponent.js b/src/util/mayContainChildComponent.js
index 43a03ef..5e1035e 100644 index 65000a0..09b199a 100644
--- a/src/util/mayContainChildComponent.js --- a/src/util/mayContainChildComponent.js
+++ b/src/util/mayContainChildComponent.js +++ b/src/util/mayContainChildComponent.js
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@

View File

@ -1,8 +1,8 @@
diff --git a/lib/index.js b/lib/index.js diff --git a/lib/index.js b/lib/index.js
index 49fd4c7..a0fdd81 100644 index de95218..e30a3df 100644
--- a/lib/index.js --- a/lib/index.js
+++ b/lib/index.js +++ b/lib/index.js
@@ -1,9 +1,9 @@ @@ -1,17 +1,17 @@
"use strict" "use strict"
-const pkg = require("../package.json") -const pkg = require("../package.json")
@ -14,18 +14,17 @@ index 49fd4c7..a0fdd81 100644
+import cjsConfig from "./configs/recommended-script" +import cjsConfig from "./configs/recommended-script"
+import recommendedConfig from "./configs/recommended" +import recommendedConfig from "./configs/recommended"
/** /** @import { ESLint, Linter } from 'eslint' */
* @typedef {{
@@ -20,8 +20,8 @@ const recommendedConfig = require("./configs/recommended") /** @type {ESLint.Plugin} */
/** @type {import('eslint').ESLint.Plugin & { configs: Configs }} */ const base = {
const plugin = {
meta: { meta: {
- name: pkg.name, - name: pkg.name,
- version: pkg.version, - version: pkg.version,
+ name, + name,
+ version, + version,
}, },
rules: /** @type {Record<string, import('eslint').Rule.RuleModule>} */ ({ rules: {
"callback-return": require("./rules/callback-return"), "callback-return": require("./rules/callback-return"),
diff --git a/tests/fixtures/no-extraneous/dependencies/node_modules/@bbb/aaa.js b/tests/fixtures/no-extraneous/dependencies/node_modules/@bbb/aaa.js diff --git a/tests/fixtures/no-extraneous/dependencies/node_modules/@bbb/aaa.js b/tests/fixtures/no-extraneous/dependencies/node_modules/@bbb/aaa.js
deleted file mode 100644 deleted file mode 100644

10
pnpm-lock.yaml generated
View File

@ -31,8 +31,8 @@ importers:
.: .:
devDependencies: devDependencies:
'@aet/eslint-define-config': '@aet/eslint-define-config':
specifier: ^0.1.0-beta.32 specifier: ^0.1.0-beta.33
version: 0.1.0-beta.32 version: 0.1.0-beta.33
'@antfu/install-pkg': '@antfu/install-pkg':
specifier: ^0.4.1 specifier: ^0.4.1
version: 0.4.1 version: 0.4.1
@ -216,8 +216,8 @@ importers:
packages: packages:
'@aet/eslint-define-config@0.1.0-beta.32': '@aet/eslint-define-config@0.1.0-beta.33':
resolution: {integrity: sha512-yIVGAaxg8SOy0I3TvEmWEOtbwnGNR77ltuUDZ9Uc91T9K6y11Pw7P7rO2tJwkaFSUmNO5taOSMqQIYigayd5UQ==} resolution: {integrity: sha512-r3uIyhk+xucAf3xzfjvR53YT009+0Gc0zxygUf9jBx9FkVDAdp8FZbTNxP+IqMAk+RprThI/dj9+C8xPAMlPJA==}
engines: {node: '>=18.0.0', npm: '>=9.0.0'} engines: {node: '>=18.0.0', npm: '>=9.0.0'}
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
@ -2928,7 +2928,7 @@ packages:
snapshots: snapshots:
'@aet/eslint-define-config@0.1.0-beta.32': {} '@aet/eslint-define-config@0.1.0-beta.33': {}
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
dependencies: dependencies:

View File

@ -18,10 +18,10 @@
"subject": "[New] `label-has-associated-control`: allow `labelComponents` to contain globs" "subject": "[New] `label-has-associated-control`: allow `labelComponents` to contain globs"
}, },
"eslint-plugin-n": { "eslint-plugin-n": {
"hash": "d39d99aecf2e8f0dde59b980f209d1c377af9a46", "hash": "c4d15512b24a8c7c3ba4bf8b598e66eafd1baeec",
"date": "2024-11-02T00:28:49+01:00", "date": "2024-11-07T20:14:17+08:00",
"committer": "GitHub", "committer": "GitHub",
"subject": "feat(no-unsupported): support Node 20.18.0 (#374)" "subject": "chore(master): release 17.13.1 (#381)"
}, },
"eslint-plugin-react": { "eslint-plugin-react": {
"hash": "983b88dd3cb5e07919517d3fde4085f60883ded7", "hash": "983b88dd3cb5e07919517d3fde4085f60883ded7",

View File

@ -25,7 +25,7 @@ export async function extendConfig(
middlewares?: Middleware[]; middlewares?: Middleware[];
configs: FlatESLintConfig[]; configs: FlatESLintConfig[];
gitignore?: boolean; gitignore?: boolean;
}, } = [],
): Promise<FlatESLintConfig[]> { ): Promise<FlatESLintConfig[]> {
const { const {
auto = true, auto = true,

View File

@ -13,5 +13,11 @@ export default defineConfig([
{ {
name: 'eslint-rules/tailwind', name: 'eslint-rules/tailwind',
rules: tailwindRules, rules: tailwindRules,
settings: {
tailwindcss: {
callees: ['classnames', 'clsx', 'tw', 'twx'],
classRegex: '^(css|class(Name)?)$',
},
},
}, },
]); ]);