Nozomi's Recommended eslint Config.
via GIPHY
npx -y @nozomiishii/eslint-config@latest
pnpm add -D eslint typescript eslint-define-config @nozomiishii/eslint-config && touch .eslintrc.cjs
scriptの設定
pnpm pkg set scripts.eslint="eslint . --max-warnings=0 --ignore-path .gitignore" \
pnpm pkg set scripts.lint="pnpm eslint" \
pnpm pkg set scripts.lint:fix="pnpm eslint --fix"
package.json
{
"scripts": {
"eslint": "eslint . --max-warnings=0 --ignore-path .gitignore",
"lint": "pnpm eslint",
"lint:fix": "pnpm eslint --fix"
}
}
.eslintrc.cjs
// @ts-check
const { defineConfig } = require('eslint-define-config');
module.exports = defineConfig({
root: true,
ignorePatterns: ['.eslintrc.cjs', '*.config.*'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
tsconfigRootDir: __dirname,
project: true,
sourceType: 'module',
},
extends: '@nozomiishii',
});