@@ -11,7 +11,15 @@ const eslintDeps = eslintTemplatePackage.devDependencies
1111
1212export default function renderEslint (
1313 rootDir ,
14- { needsTypeScript, needsVitest, needsCypress, needsCypressCT, needsPrettier, needsPlaywright } ,
14+ {
15+ needsTypeScript,
16+ needsVitest,
17+ needsCypress,
18+ needsCypressCT,
19+ needsOxlint,
20+ needsPrettier,
21+ needsPlaywright,
22+ } ,
1523) {
1624 const additionalConfigs = getAdditionalConfigs ( {
1725 needsVitest,
@@ -23,32 +31,20 @@ export default function renderEslint(
2331 const { pkg, files } = createESLintConfig ( {
2432 styleGuide : 'default' ,
2533 hasTypeScript : needsTypeScript ,
34+ needsOxlint,
35+ // Theoretically, we could add Prettier without requring ESLint.
36+ // But it doesn't seem to be a good practice, so we just let createESLintConfig handle it.
2637 needsPrettier,
27-
2838 additionalConfigs,
2939 } )
3040
31- const scripts : Record < string , string > = {
32- lint : 'eslint . --fix' ,
33- }
34-
35- // Theoretically, we could add Prettier without requring ESLint.
36- // But it doesn't seem to be a good practice, so we just leave it here.
37- if ( needsPrettier ) {
38- // Default to only format the `src/` directory to avoid too much noise, and
39- // the need for a `.prettierignore` file.
40- // Users can still append any paths they'd like to format to the command,
41- // e.g. `npm run format cypress/`.
42- scripts . format = 'prettier --write src/'
43- }
44-
4541 // update package.json
4642 const packageJsonPath = path . resolve ( rootDir , 'package.json' )
4743 const existingPkg = JSON . parse ( fs . readFileSync ( packageJsonPath , 'utf8' ) )
48- const updatedPkg = sortDependencies ( deepMerge ( deepMerge ( existingPkg , pkg ) , { scripts } ) )
44+ const updatedPkg = sortDependencies ( deepMerge ( existingPkg , pkg ) )
4945 fs . writeFileSync ( packageJsonPath , JSON . stringify ( updatedPkg , null , 2 ) + '\n' , 'utf8' )
5046
51- // write to eslint.config.mjs , .prettierrc.json, .editorconfig, etc.
47+ // write to eslint.config.js , .prettierrc.json, .editorconfig, etc.
5248 for ( const [ fileName , content ] of Object . entries ( files ) ) {
5349 const fullPath = path . resolve ( rootDir , fileName )
5450 fs . writeFileSync ( fullPath , content as string , 'utf8' )
0 commit comments