Update
This commit is contained in:
parent
3debdb9e74
commit
08cf6729ae
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
eslint-plugin-import
|
eslint-plugin-import
|
||||||
eslint-plugin-jsx-a11y
|
eslint-plugin-jsx-a11y
|
||||||
eslint-plugin-react
|
eslint-plugin-react
|
||||||
|
eslint-plugin-n
|
||||||
jsx-ast-utils
|
jsx-ast-utils
|
||||||
/react
|
/react
|
||||||
|
|
||||||
|
8
dist/package.json
vendored
8
dist/package.json
vendored
@ -1,21 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "@aet/eslint-rules",
|
"name": "@aet/eslint-rules",
|
||||||
"version": "0.0.1-beta.16",
|
"version": "0.0.1-beta.17",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5.1.6"
|
"typescript": "^5.1.6"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"eslint-add-alias": "./addAlias.js"
|
"eslint-add-alias": "./add-alias.js",
|
||||||
|
"eslint-remove-alias": "./remove-alias.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/eslint": "^8.44.0",
|
"@types/eslint": "^8.44.1",
|
||||||
"aria-query": "^5.3.0",
|
"aria-query": "^5.3.0",
|
||||||
"axe-core": "4.7.2",
|
"axe-core": "4.7.2",
|
||||||
"axobject-query": "^3.2.1",
|
"axobject-query": "^3.2.1",
|
||||||
"damerau-levenshtein": "1.0.8",
|
"damerau-levenshtein": "1.0.8",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
|
"emoji-regex": "^10.2.1",
|
||||||
"eslint-define-config": "^1.21.0",
|
"eslint-define-config": "^1.21.0",
|
||||||
"eslint-import-resolver-node": "^0.3.7",
|
"eslint-import-resolver-node": "^0.3.7",
|
||||||
"eslint-module-utils": "^2.8.0",
|
"eslint-module-utils": "^2.8.0",
|
||||||
|
@ -227,5 +227,6 @@ main('./eslint-plugin-import/src/index.js', './dist/import/index.js');
|
|||||||
main('./eslint-plugin-jsx-a11y/src/index.js', './dist/jsx-a11y/index.js');
|
main('./eslint-plugin-jsx-a11y/src/index.js', './dist/jsx-a11y/index.js');
|
||||||
main('./eslint-plugin-react-hooks/index.ts', './dist/react-hooks/index.js');
|
main('./eslint-plugin-react-hooks/index.ts', './dist/react-hooks/index.js');
|
||||||
main('./eslint-plugin-n/lib/index.js', './dist/n/index.js');
|
main('./eslint-plugin-n/lib/index.js', './dist/n/index.js');
|
||||||
main('./src/addAlias.ts', './dist/addAlias.js');
|
main('./src/add-alias.ts', './dist/add-alias.js');
|
||||||
|
main('./src/remove-alias.ts', './dist/remove-alias.js');
|
||||||
main('./src/rules/index.ts', './dist/rules/index.js');
|
main('./src/rules/index.ts', './dist/rules/index.js');
|
||||||
|
@ -71,7 +71,7 @@ index 0f1cd04..bfed363 100644
|
|||||||
+export { hasProp } from './src';
|
+export { hasProp } from './src';
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
diff --git a/package.json b/package.json
|
diff --git a/package.json b/package.json
|
||||||
index 738d1b3..befb66e 100644
|
index 40f7947..4759eca 100644
|
||||||
--- a/package.json
|
--- a/package.json
|
||||||
+++ b/package.json
|
+++ b/package.json
|
||||||
@@ -2,7 +2,7 @@
|
@@ -2,7 +2,7 @@
|
||||||
|
@ -6,9 +6,9 @@ import { name } from '../dist/package.json';
|
|||||||
const pkgPath = resolve(process.cwd(), 'package.json');
|
const pkgPath = resolve(process.cwd(), 'package.json');
|
||||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
||||||
|
|
||||||
pkg.devDependencies ??= {};
|
const devDeps = (pkg.devDependencies ??= {});
|
||||||
|
|
||||||
Object.assign(pkg.devDependencies, {
|
Object.assign(devDeps, {
|
||||||
'eslint-plugin-import': `file:./node_modules/${name}/import`,
|
'eslint-plugin-import': `file:./node_modules/${name}/import`,
|
||||||
'eslint-plugin-jsx-a11y': `file:./node_modules/${name}/jsx-a11y`,
|
'eslint-plugin-jsx-a11y': `file:./node_modules/${name}/jsx-a11y`,
|
||||||
'eslint-plugin-local': `file:./node_modules/${name}/local`,
|
'eslint-plugin-local': `file:./node_modules/${name}/local`,
|
||||||
@ -17,4 +17,19 @@ Object.assign(pkg.devDependencies, {
|
|||||||
'eslint-plugin-react-hooks': `file:./node_modules/${name}/react-hooks`,
|
'eslint-plugin-react-hooks': `file:./node_modules/${name}/react-hooks`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
devDeps['@typescript-eslint/eslint-plugin'] ??= '6.2.0';
|
||||||
|
devDeps['@typescript-eslint/parser'] ??= '6.2.0';
|
||||||
|
|
||||||
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
||||||
|
|
||||||
|
const eslintrc = resolve(process.cwd(), '.eslintrc.js');
|
||||||
|
if (fs.existsSync(eslintrc)) {
|
||||||
|
fs.writeFileSync(
|
||||||
|
eslintrc,
|
||||||
|
`const { extendConfig } = require('@aet/eslint-rules/basic');
|
||||||
|
|
||||||
|
module.exports = extendConfig({
|
||||||
|
extends: [],
|
||||||
|
});`,
|
||||||
|
);
|
||||||
|
}
|
23
src/remove-alias.ts
Normal file
23
src/remove-alias.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import fs from 'node:fs';
|
||||||
|
import { resolve } from 'node:path';
|
||||||
|
import { name } from '../dist/package.json';
|
||||||
|
|
||||||
|
const pkgPath = resolve(process.cwd(), 'package.json');
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
||||||
|
|
||||||
|
const devDeps = (pkg.devDependencies ??= {});
|
||||||
|
for (const dep of [
|
||||||
|
'eslint-plugin-import',
|
||||||
|
'eslint-plugin-jsx-a11y',
|
||||||
|
'eslint-plugin-local',
|
||||||
|
'eslint-plugin-rules',
|
||||||
|
'eslint-plugin-react',
|
||||||
|
'eslint-plugin-react-hooks',
|
||||||
|
]) {
|
||||||
|
if (devDeps[dep]?.startsWith(`file:./node_modules/${name}/`)) {
|
||||||
|
delete devDeps[dep];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
Loading…
x
Reference in New Issue
Block a user