The Jared Wilcurt's base ESLint 9+ rules for ESM projects.
For CJS and ESLint < v9, use v2.x releases.
- If you don't have a
package.json
donpm init -y
first - Run
npm pkg set type=module
- Run
npm install --save-dev eslint eslint-config-tjw-base @stylistic/eslint-plugin
- In your
eslint.config.js
addtjwBase
to your config like so:import js from '@eslint/js'; import tjwBase from 'eslint-config-tjw-base'; export default [ js.configs.recommended, tjwBase.configs.recommended, { // project specific settings } ];
- Run
npm pkg set scripts.lint="eslint *.js src"
- Change
*.js src
to your files and folders you want to be linted
- Change
- Run
npm run lint
See also: