@@ -78,11 +78,12 @@ module.exports.handler = async function handler(options) {
7878 'codemod-cli' : `^${ pkg . version } ` ,
7979 } ,
8080 devDependencies : {
81+ '@eslint/js' : `^${ await latestVersion ( '@eslint/js' ) } ` ,
8182 coveralls : pkg . devDependencies . coveralls ,
8283 eslint : `^${ await latestVersion ( 'eslint' ) } ` ,
8384 'eslint-config-prettier' : `^${ await latestVersion ( 'eslint-config-prettier' ) } ` ,
84- 'eslint-plugin-node ' : `^${ await latestVersion ( 'eslint-plugin-node ' ) } ` ,
85- 'eslint-plugin-prettier' : `^${ await latestVersion ( 'eslint-plugin-prettier ' ) } ` ,
85+ 'eslint-plugin-n ' : `^${ await latestVersion ( 'eslint-plugin-n ' ) } ` ,
86+ globals : `^${ await latestVersion ( 'globals ' ) } ` ,
8687 jest : pkg . devDependencies . jest ,
8788 prettier : `^${ await latestVersion ( 'prettier' ) } ` ,
8889 } ,
@@ -98,35 +99,20 @@ module.exports.handler = async function handler(options) {
9899
99100 // linting setup
100101 fs . outputFileSync (
101- projectName + '/.eslintrc.js ' ,
102+ projectName + '/eslint.config.mjs ' ,
102103 stripIndent `
103- module.exports = {
104- parserOptions: {
105- ecmaVersion: 2018,
106- },
107-
108- plugins: ['prettier', 'node'],
109- extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:node/recommended'],
110- env: {
111- node: true,
112- },
113- rules: {},
114- overrides: [
115- {
116- files: ['__tests__/**/*.js'],
117- env: {
118- jest: true,
119- },
120- },
121- ],
122- };` + '\n'
123- ) ;
124- fs . outputFileSync (
125- projectName + '/.eslintignore' ,
126- stripIndent `
127- !.*
128- __testfixtures__
129- `
104+ import js from "@eslint/js";
105+ import n from "eslint-plugin-n";
106+ import globals from "globals";
107+ import { defineConfig } from "eslint/config";
108+
109+ export default defineConfig([
110+ js.configs.recommended,
111+ { files: ["**/*.{js,mjs,cjs}"], plugins: { n }, languageOptions: { globals: globals.node } },
112+ { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
113+ { ignores: ['!.*', '__testfixtures__'] }
114+ ]);
115+ ` + '\n'
130116 ) ;
131117 fs . outputFileSync (
132118 projectName + '/.prettierrc' ,
0 commit comments