Bump
This commit is contained in:
parent
f36e47f144
commit
235cf4101b
29
dist/config/index.d.ts
vendored
29
dist/config/index.d.ts
vendored
@ -7,6 +7,21 @@ export type Middleware =
|
|||||||
| (() => Promise<MiddlewareResult>)
|
| (() => Promise<MiddlewareResult>)
|
||||||
| (() => Promise<{ default: MiddlewareResult }>);
|
| (() => Promise<{ default: MiddlewareResult }>);
|
||||||
|
|
||||||
|
export interface NormalizedExtendConfigOptions {
|
||||||
|
auto?: boolean;
|
||||||
|
middlewares?: Middleware[];
|
||||||
|
configs: FlatESLintConfig[];
|
||||||
|
/**
|
||||||
|
* Use `.gitignore` file to exclude files from ESLint.
|
||||||
|
*/
|
||||||
|
gitignore?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ExtendConfigOptions =
|
||||||
|
| FlatESLintConfig
|
||||||
|
| FlatESLintConfig[]
|
||||||
|
| NormalizedExtendConfigOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a ESLint config object.
|
* Returns a ESLint config object.
|
||||||
*
|
*
|
||||||
@ -28,19 +43,7 @@ export type Middleware =
|
|||||||
*
|
*
|
||||||
* @returns ESLint configuration object.
|
* @returns ESLint configuration object.
|
||||||
*/
|
*/
|
||||||
export function extendConfig(
|
export function extendConfig(options?: ExtendConfigOptions): Promise<FlatESLintConfig[]>;
|
||||||
options:
|
|
||||||
| FlatESLintConfig[]
|
|
||||||
| {
|
|
||||||
auto?: boolean;
|
|
||||||
middlewares?: Middleware[];
|
|
||||||
configs: FlatESLintConfig[];
|
|
||||||
/**
|
|
||||||
* Use `.gitignore` file to exclude files from ESLint.
|
|
||||||
*/
|
|
||||||
gitignore?: boolean;
|
|
||||||
},
|
|
||||||
): Promise<FlatESLintConfig[]>;
|
|
||||||
|
|
||||||
export const error = 'error';
|
export const error = 'error';
|
||||||
export const warn = 'warn';
|
export const warn = 'warn';
|
||||||
|
26
dist/package.json
vendored
26
dist/package.json
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aet/eslint-rules",
|
"name": "@aet/eslint-rules",
|
||||||
"version": "2.0.7",
|
"version": "2.0.10",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"main": "./config/index.js",
|
"main": "./config/index.js",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^9.14.0",
|
"eslint": "^9.15.0",
|
||||||
"typescript": "^5.6.3"
|
"typescript": "^5.6.3"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
@ -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.35",
|
"@aet/eslint-define-config": "^0.1.0-beta.36",
|
||||||
"@eslint/js": "^9.15.0",
|
"@eslint/js": "^9.15.0",
|
||||||
"@eslint-community/eslint-utils": "^4.4.1",
|
"@eslint-community/eslint-utils": "^4.4.1",
|
||||||
|
"@eslint-react/eslint-plugin": "1.17.1",
|
||||||
|
"@stylistic/eslint-plugin": "^2.11.0",
|
||||||
"@types/eslint": "^9.6.1",
|
"@types/eslint": "^9.6.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
||||||
"@typescript-eslint/parser": "^8.14.0",
|
"@typescript-eslint/parser": "^8.15.0",
|
||||||
"@eslint-react/eslint-plugin": "1.16.1",
|
"@typescript-eslint/type-utils": "^8.15.0",
|
||||||
"@stylistic/eslint-plugin": "^2.10.1",
|
"@typescript-eslint/utils": "^8.15.0",
|
||||||
"@typescript-eslint/type-utils": "^8.14.0",
|
|
||||||
"@typescript-eslint/utils": "^8.14.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,13 +36,13 @@
|
|||||||
"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.14.0",
|
"typescript-eslint": "^8.15.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",
|
||||||
"eslint-module-utils": "^2.12.0",
|
"eslint-module-utils": "^2.12.0",
|
||||||
"eslint-plugin-import-x": "^4.4.2",
|
"eslint-plugin-import-x": "^4.4.3",
|
||||||
"eslint-plugin-unicorn": "^56.0.0",
|
"eslint-plugin-unicorn": "^56.0.1",
|
||||||
"esprima": "^4.0.1",
|
"esprima": "^4.0.1",
|
||||||
"esquery": "^1.6.0",
|
"esquery": "^1.6.0",
|
||||||
"estraverse": "^5.3.0",
|
"estraverse": "^5.3.0",
|
||||||
@ -71,4 +71,4 @@
|
|||||||
"**/is-core-module": "file:./overrides/is-core-module",
|
"**/is-core-module": "file:./overrides/is-core-module",
|
||||||
"**/supports-preserve-symlinks-flag": "file:./overrides/supports-preserve-symlinks-flag"
|
"**/supports-preserve-symlinks-flag": "file:./overrides/supports-preserve-symlinks-flag"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
package.json
32
package.json
@ -10,15 +10,15 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@aet/eslint-define-config": "^0.1.0-beta.35",
|
"@aet/eslint-define-config": "^0.1.0-beta.36",
|
||||||
"@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",
|
||||||
"@babel/preset-env": "^7.26.0",
|
"@babel/preset-env": "^7.26.0",
|
||||||
"@eslint-react/eslint-plugin": "^1.16.1",
|
"@eslint-react/eslint-plugin": "^1.17.1",
|
||||||
"@eslint/js": "^9.15.0",
|
"@eslint/js": "^9.15.0",
|
||||||
"@graphql-eslint/eslint-plugin": "^3.20.1",
|
"@graphql-eslint/eslint-plugin": "^3.20.1",
|
||||||
"@stylistic/eslint-plugin": "^2.10.1",
|
"@stylistic/eslint-plugin": "^2.11.0",
|
||||||
"@swc-node/register": "^1.10.9",
|
"@swc-node/register": "^1.10.9",
|
||||||
"@tanstack/eslint-plugin-query": "^5.60.1",
|
"@tanstack/eslint-plugin-query": "^5.60.1",
|
||||||
"@types/babel-plugin-macros": "^3.1.3",
|
"@types/babel-plugin-macros": "^3.1.3",
|
||||||
@ -32,14 +32,14 @@
|
|||||||
"@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.9.0",
|
"@types/node": "^22.9.3",
|
||||||
"@types/react-refresh": "^0.14.6",
|
"@types/react-refresh": "^0.14.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.14.0",
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
||||||
"@typescript-eslint/parser": "^8.14.0",
|
"@typescript-eslint/parser": "^8.15.0",
|
||||||
"@typescript-eslint/type-utils": "^8.14.0",
|
"@typescript-eslint/type-utils": "^8.15.0",
|
||||||
"@typescript-eslint/types": "^8.14.0",
|
"@typescript-eslint/types": "^8.15.0",
|
||||||
"@typescript-eslint/typescript-estree": "^8.14.0",
|
"@typescript-eslint/typescript-estree": "^8.15.0",
|
||||||
"@typescript-eslint/utils": "^8.14.0",
|
"@typescript-eslint/utils": "^8.15.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",
|
||||||
@ -47,12 +47,12 @@
|
|||||||
"eslint": "9.15.0",
|
"eslint": "9.15.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.2",
|
"eslint-plugin-import-x": "^4.4.3",
|
||||||
"eslint-plugin-jsdoc": "^50.5.0",
|
"eslint-plugin-jsdoc": "^50.5.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.14",
|
"eslint-plugin-react-refresh": "^0.4.14",
|
||||||
"eslint-plugin-storybook": "canary",
|
"eslint-plugin-storybook": "canary",
|
||||||
"eslint-plugin-testing-library": "^6.4.0",
|
"eslint-plugin-testing-library": "^6.5.0",
|
||||||
"eslint-plugin-unicorn": "^56.0.0",
|
"eslint-plugin-unicorn": "^56.0.1",
|
||||||
"eslint-plugin-vitest": "^0.5.4",
|
"eslint-plugin-vitest": "^0.5.4",
|
||||||
"esprima": "^4.0.1",
|
"esprima": "^4.0.1",
|
||||||
"esquery": "^1.6.0",
|
"esquery": "^1.6.0",
|
||||||
@ -68,9 +68,9 @@
|
|||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"terser": "^5.36.0",
|
"terser": "^5.36.0",
|
||||||
"type-fest": "^4.27.0",
|
"type-fest": "^4.27.1",
|
||||||
"typescript": "^5.6.3",
|
"typescript": "^5.7.2",
|
||||||
"typescript-eslint": "^8.14.0"
|
"typescript-eslint": "^8.15.0"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
diff --git a/src/index.js b/src/index.js
|
diff --git a/src/index.js b/src/index.js
|
||||||
index 2fa185f..3cf8018 100644
|
index 980081e..3cf8018 100644
|
||||||
--- a/src/index.js
|
--- a/src/index.js
|
||||||
+++ b/src/index.js
|
+++ b/src/index.js
|
||||||
@@ -1,48 +1,90 @@
|
@@ -1,48 +1,90 @@
|
||||||
@ -160,7 +160,7 @@ index 2fa185f..3cf8018 100644
|
|||||||
strict: createConfig(strictRules, 'strict'),
|
strict: createConfig(strictRules, 'strict'),
|
||||||
};
|
};
|
||||||
|
|
||||||
-module.exports = { ...jsxA11y, configs, flatConfigs };
|
-module.exports = Object.assign(jsxA11y, { configs, flatConfigs });
|
||||||
+export default { ...jsxA11y, configs, flatConfigs };
|
+export default { ...jsxA11y, configs, flatConfigs };
|
||||||
diff --git a/src/rules/autocomplete-valid.js b/src/rules/autocomplete-valid.js
|
diff --git a/src/rules/autocomplete-valid.js b/src/rules/autocomplete-valid.js
|
||||||
index df7b6b8..c4d0da1 100644
|
index df7b6b8..c4d0da1 100644
|
||||||
|
809
pnpm-lock.yaml
generated
809
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -12,16 +12,16 @@
|
|||||||
"subject": "chore(deps): update dependency @types/node to ^18.19.63 (#320)"
|
"subject": "chore(deps): update dependency @types/node to ^18.19.63 (#320)"
|
||||||
},
|
},
|
||||||
"eslint-plugin-jsx-a11y": {
|
"eslint-plugin-jsx-a11y": {
|
||||||
"hash": "743168b1ba15196ec7001c7c1f368f5efbe78f0d",
|
"hash": "7566e13531f09a040daee4c16d0cba0c28d321c4",
|
||||||
"date": "2024-10-23T13:27:41+10:00",
|
"date": "2024-11-17T09:51:03-08:00",
|
||||||
"committer": "Jordan Harband",
|
"committer": "Jordan Harband",
|
||||||
"subject": "[New] `label-has-associated-control`: allow `labelComponents` to contain globs"
|
"subject": "[Deps] update `axe-core`"
|
||||||
},
|
},
|
||||||
"eslint-plugin-n": {
|
"eslint-plugin-n": {
|
||||||
"hash": "c4d15512b24a8c7c3ba4bf8b598e66eafd1baeec",
|
"hash": "ccf5f9e482c32f2fd2d5f78649d7f837a5db8870",
|
||||||
"date": "2024-11-07T20:14:17+08:00",
|
"date": "2024-11-21T21:05:02+01:00",
|
||||||
"committer": "GitHub",
|
"committer": "GitHub",
|
||||||
"subject": "chore(master): release 17.13.1 (#381)"
|
"subject": "chore(master): release 17.14.0 (#387)"
|
||||||
},
|
},
|
||||||
"eslint-plugin-react": {
|
"eslint-plugin-react": {
|
||||||
"hash": "983b88dd3cb5e07919517d3fde4085f60883ded7",
|
"hash": "983b88dd3cb5e07919517d3fde4085f60883ded7",
|
||||||
|
29
src/config.d.ts
vendored
29
src/config.d.ts
vendored
@ -7,6 +7,21 @@ export type Middleware =
|
|||||||
| (() => Promise<MiddlewareResult>)
|
| (() => Promise<MiddlewareResult>)
|
||||||
| (() => Promise<{ default: MiddlewareResult }>);
|
| (() => Promise<{ default: MiddlewareResult }>);
|
||||||
|
|
||||||
|
export interface NormalizedExtendConfigOptions {
|
||||||
|
auto?: boolean;
|
||||||
|
middlewares?: Middleware[];
|
||||||
|
configs: FlatESLintConfig[];
|
||||||
|
/**
|
||||||
|
* Use `.gitignore` file to exclude files from ESLint.
|
||||||
|
*/
|
||||||
|
gitignore?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ExtendConfigOptions =
|
||||||
|
| FlatESLintConfig
|
||||||
|
| FlatESLintConfig[]
|
||||||
|
| NormalizedExtendConfigOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a ESLint config object.
|
* Returns a ESLint config object.
|
||||||
*
|
*
|
||||||
@ -28,19 +43,7 @@ export type Middleware =
|
|||||||
*
|
*
|
||||||
* @returns ESLint configuration object.
|
* @returns ESLint configuration object.
|
||||||
*/
|
*/
|
||||||
export function extendConfig(
|
export function extendConfig(options?: ExtendConfigOptions): Promise<FlatESLintConfig[]>;
|
||||||
options:
|
|
||||||
| FlatESLintConfig[]
|
|
||||||
| {
|
|
||||||
auto?: boolean;
|
|
||||||
middlewares?: Middleware[];
|
|
||||||
configs: FlatESLintConfig[];
|
|
||||||
/**
|
|
||||||
* Use `.gitignore` file to exclude files from ESLint.
|
|
||||||
*/
|
|
||||||
gitignore?: boolean;
|
|
||||||
},
|
|
||||||
): Promise<FlatESLintConfig[]>;
|
|
||||||
|
|
||||||
export const error = 'error';
|
export const error = 'error';
|
||||||
export const warn = 'warn';
|
export const warn = 'warn';
|
||||||
|
44
src/index.ts
44
src/index.ts
@ -7,6 +7,7 @@ import importPlugin from 'eslint-plugin-import-x';
|
|||||||
import { uniq } from 'lodash-es';
|
import { uniq } from 'lodash-es';
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
import type { ExtendConfigOptions, NormalizedExtendConfigOptions } from './config';
|
||||||
import { off } from './constants';
|
import { off } from './constants';
|
||||||
import { checkEnv } from './environment';
|
import { checkEnv } from './environment';
|
||||||
import { Middleware } from './middleware';
|
import { Middleware } from './middleware';
|
||||||
@ -17,22 +18,39 @@ import unicorn from './presets/unicorn';
|
|||||||
|
|
||||||
export { error, warn, off } from './constants';
|
export { error, warn, off } from './constants';
|
||||||
|
|
||||||
export async function extendConfig(
|
function normalizeExtendConfig(
|
||||||
options:
|
options: ExtendConfigOptions,
|
||||||
| FlatESLintConfig[]
|
): NormalizedExtendConfigOptions {
|
||||||
| {
|
if (Array.isArray(options)) {
|
||||||
auto?: boolean;
|
options = { configs: options };
|
||||||
middlewares?: Middleware[];
|
} else if ('rules' in options) {
|
||||||
configs: FlatESLintConfig[];
|
options = { configs: [options] };
|
||||||
gitignore?: boolean;
|
}
|
||||||
} = [],
|
|
||||||
): Promise<FlatESLintConfig[]> {
|
|
||||||
const {
|
const {
|
||||||
auto = true,
|
auto = true,
|
||||||
middlewares: addMiddlewares = [],
|
middlewares = [],
|
||||||
configs = [],
|
configs = [],
|
||||||
gitignore = true,
|
gitignore = true,
|
||||||
} = Array.isArray(options) ? { configs: options } : options;
|
} = options as NormalizedExtendConfigOptions;
|
||||||
|
|
||||||
|
return {
|
||||||
|
auto,
|
||||||
|
middlewares,
|
||||||
|
configs,
|
||||||
|
gitignore,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function extendConfig(
|
||||||
|
options: ExtendConfigOptions = [],
|
||||||
|
): Promise<FlatESLintConfig[]> {
|
||||||
|
const {
|
||||||
|
auto,
|
||||||
|
middlewares: addMiddlewares = [],
|
||||||
|
configs,
|
||||||
|
gitignore,
|
||||||
|
} = normalizeExtendConfig(options);
|
||||||
|
|
||||||
const middlewares: Middleware[] = uniq([
|
const middlewares: Middleware[] = uniq([
|
||||||
() => import('./presets/custom'),
|
() => import('./presets/custom'),
|
||||||
@ -113,7 +131,7 @@ export async function extendConfig(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configs) {
|
if (configs?.length) {
|
||||||
result.push(...configs);
|
result.push(...configs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user