Update
This commit is contained in:
@ -6,9 +6,9 @@ import { name } from '../dist/package.json';
|
||||
const pkgPath = resolve(process.cwd(), 'package.json');
|
||||
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-jsx-a11y': `file:./node_modules/${name}/jsx-a11y`,
|
||||
'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`,
|
||||
});
|
||||
|
||||
devDeps['@typescript-eslint/eslint-plugin'] ??= '6.2.0';
|
||||
devDeps['@typescript-eslint/parser'] ??= '6.2.0';
|
||||
|
||||
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));
|
Reference in New Issue
Block a user