This commit is contained in:
Alex 2024-08-04 21:59:18 -04:00
parent f3fbf99c0c
commit 25695599aa
6 changed files with 16 additions and 10 deletions

View File

@ -4,8 +4,12 @@ Personal ESLint config. Guaranteed to have no useless polyfills.
## 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)
- ✅ [unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1886)
- ❌ [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)
| 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
View File

@ -1,6 +1,6 @@
{
"name": "@aet/eslint-rules",
"version": "1.0.1-beta.18",
"version": "1.0.1-beta.20",
"license": "UNLICENSED",
"bin": {
"eslint-install": "install.js",
@ -11,6 +11,7 @@
"typescript": "^5.4.4"
},
"dependencies": {
"@antfu/install-pkg": "^0.3.3",
"@nolyfill/is-core-module": "^1.0.39",
"@aet/eslint-define-config": "^0.1.0-beta.17",
"@eslint-community/eslint-utils": "^4.4.0",
@ -64,4 +65,4 @@
"**/is-core-module": "file:./overrides/is-core-module",
"**/supports-preserve-symlinks-flag": "file:./overrides/supports-preserve-symlinks-flag"
}
}
}

View File

@ -111,7 +111,7 @@ async function bundle(
comments: true,
},
});
setText(minified.code!);
await setText(minified.code!);
}
return output;
@ -151,10 +151,10 @@ function bundleType(source: string, output: string) {
}
async function main() {
console.log('Building local rules...');
console.log('Building local rules');
await buildLocalRules();
console.log('Building type definitions...');
console.log('Building type definitions');
bundleType('./src/index.ts', './dist/index.d.ts');
bundleType('./src/prettier.ts', './dist/prettier.d.ts');
bundleType('./src/types.ts', './dist/types.d.ts');
@ -162,7 +162,7 @@ async function main() {
const unminify = { minify: false };
const treeShake = { treeShaking: true, minify: false };
console.log('Building packages...');
console.log('Building packages');
await Promise.all([
bundle('./packages/eslint-plugin-jsx-a11y/src/index.js'),
bundle('./packages/eslint-plugin-react-hooks/index.ts'),
@ -177,7 +177,7 @@ async function main() {
editPackageJson(),
]);
console.log('Removing redirect...');
console.log('Removing redirect');
const [distIndex, setDistIndex] = await useText('./dist/index.js');
await setDistIndex(distIndex.replace(/import.*redirect.*;/g, ''));
}

View File

@ -1,8 +1,8 @@
#!/usr/bin/env node
import * as ts from 'typescript';
import {
generateDtsBundle,
type EntryPointConfig,
generateDtsBundle,
} from 'dts-bundle-generator/dist/bundle-generator';
export function dts({

View File

@ -67,6 +67,7 @@ export const importTypeScript = defineMiddleware((config, { addRules, addSetting
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
'@typescript-eslint/no-require-imports': off,
'import-x/no-commonjs': off,
'rules/restrict-template-expressions': off,
},
},

View File

@ -92,6 +92,6 @@ const unicornRules: Partial<UnicornRulesObject> = {
};
export const unicorn = defineMiddleware((config, { addRules }) => {
config.extends.push('plugin:unicorn/recommended');
config.plugins.push('unicorn');
addRules(unicornRules);
});