Update
This commit is contained in:
parent
f3fbf99c0c
commit
25695599aa
@ -4,8 +4,12 @@ Personal ESLint config. Guaranteed to have no useless polyfills.
|
|||||||
|
|
||||||
## flat config support
|
## flat config support
|
||||||
|
|
||||||
- ⏱️ [a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/978)
|
|
||||||
- ✅ [react](https://github.com/jsx-eslint/eslint-plugin-react/pull/3429)
|
- ✅ [react](https://github.com/jsx-eslint/eslint-plugin-react/pull/3429)
|
||||||
- ✅ [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1886)
|
- ✅ [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1886)
|
||||||
- ❌ [import](https://github.com/un-ts/eslint-plugin-import-x/issues/29)
|
- ❌ [import](https://github.com/un-ts/eslint-plugin-import-x/issues/29)
|
||||||
- ❌ [jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/978, supports flat config)
|
- ❌ [jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/978, supports flat config)
|
||||||
|
|
||||||
|
| Name | Flat Config | Issue |
|
||||||
|
| ------- | ----------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| react | ✅ | [jsx-eslint/eslint-plugin-react#3429](https://github.com/jsx-eslint/eslint-plugin-react/pull/3429) |
|
||||||
|
| unicorn | ✅ | [sindresorhus/eslint-plugin-unicorn#1886](https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1886) |
|
||||||
|
5
dist/package.json
vendored
5
dist/package.json
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@aet/eslint-rules",
|
"name": "@aet/eslint-rules",
|
||||||
"version": "1.0.1-beta.18",
|
"version": "1.0.1-beta.20",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"bin": {
|
"bin": {
|
||||||
"eslint-install": "install.js",
|
"eslint-install": "install.js",
|
||||||
@ -11,6 +11,7 @@
|
|||||||
"typescript": "^5.4.4"
|
"typescript": "^5.4.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@antfu/install-pkg": "^0.3.3",
|
||||||
"@nolyfill/is-core-module": "^1.0.39",
|
"@nolyfill/is-core-module": "^1.0.39",
|
||||||
"@aet/eslint-define-config": "^0.1.0-beta.17",
|
"@aet/eslint-define-config": "^0.1.0-beta.17",
|
||||||
"@eslint-community/eslint-utils": "^4.4.0",
|
"@eslint-community/eslint-utils": "^4.4.0",
|
||||||
@ -64,4 +65,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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ async function bundle(
|
|||||||
comments: true,
|
comments: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
setText(minified.code!);
|
await setText(minified.code!);
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
@ -151,10 +151,10 @@ function bundleType(source: string, output: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log('Building local rules...');
|
console.log('Building local rules…');
|
||||||
await buildLocalRules();
|
await buildLocalRules();
|
||||||
|
|
||||||
console.log('Building type definitions...');
|
console.log('Building type definitions…');
|
||||||
bundleType('./src/index.ts', './dist/index.d.ts');
|
bundleType('./src/index.ts', './dist/index.d.ts');
|
||||||
bundleType('./src/prettier.ts', './dist/prettier.d.ts');
|
bundleType('./src/prettier.ts', './dist/prettier.d.ts');
|
||||||
bundleType('./src/types.ts', './dist/types.d.ts');
|
bundleType('./src/types.ts', './dist/types.d.ts');
|
||||||
@ -162,7 +162,7 @@ async function main() {
|
|||||||
const unminify = { minify: false };
|
const unminify = { minify: false };
|
||||||
const treeShake = { treeShaking: true, minify: false };
|
const treeShake = { treeShaking: true, minify: false };
|
||||||
|
|
||||||
console.log('Building packages...');
|
console.log('Building packages…');
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
bundle('./packages/eslint-plugin-jsx-a11y/src/index.js'),
|
bundle('./packages/eslint-plugin-jsx-a11y/src/index.js'),
|
||||||
bundle('./packages/eslint-plugin-react-hooks/index.ts'),
|
bundle('./packages/eslint-plugin-react-hooks/index.ts'),
|
||||||
@ -177,7 +177,7 @@ async function main() {
|
|||||||
editPackageJson(),
|
editPackageJson(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
console.log('Removing redirect...');
|
console.log('Removing redirect…');
|
||||||
const [distIndex, setDistIndex] = await useText('./dist/index.js');
|
const [distIndex, setDistIndex] = await useText('./dist/index.js');
|
||||||
await setDistIndex(distIndex.replace(/import.*redirect.*;/g, ''));
|
await setDistIndex(distIndex.replace(/import.*redirect.*;/g, ''));
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import {
|
import {
|
||||||
generateDtsBundle,
|
|
||||||
type EntryPointConfig,
|
type EntryPointConfig,
|
||||||
|
generateDtsBundle,
|
||||||
} from 'dts-bundle-generator/dist/bundle-generator';
|
} from 'dts-bundle-generator/dist/bundle-generator';
|
||||||
|
|
||||||
export function dts({
|
export function dts({
|
||||||
|
@ -67,6 +67,7 @@ export const importTypeScript = defineMiddleware((config, { addRules, addSetting
|
|||||||
extends: ['plugin:@typescript-eslint/disable-type-checked'],
|
extends: ['plugin:@typescript-eslint/disable-type-checked'],
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-require-imports': off,
|
'@typescript-eslint/no-require-imports': off,
|
||||||
|
'import-x/no-commonjs': off,
|
||||||
'rules/restrict-template-expressions': off,
|
'rules/restrict-template-expressions': off,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -92,6 +92,6 @@ const unicornRules: Partial<UnicornRulesObject> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const unicorn = defineMiddleware((config, { addRules }) => {
|
export const unicorn = defineMiddleware((config, { addRules }) => {
|
||||||
config.extends.push('plugin:unicorn/recommended');
|
config.plugins.push('unicorn');
|
||||||
addRules(unicornRules);
|
addRules(unicornRules);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user