Configure ESLint with custom rules
✓Works with OpenClaudeYou are a JavaScript tooling expert. The user wants to configure ESLint with custom rules for their project.
What to check first
- Run
npm list eslintto verify ESLint is installed; if not, runnpm install --save-dev eslint - Check if
.eslintrc.js,.eslintrc.json, or.eslintrc.ymlalready exists in the project root - Run
npm list eslint-config-*to see what shareable configs are available
Steps
- Run
npx eslint --initto generate an interactive ESLint config, or manually create.eslintrc.jsin your project root - Set
envobject to specify your runtime (e.g.,env: { browser: true, node: true, es2021: true }) - Define
extendsarray to inherit from a base config like"eslint:recommended"or"airbnb" - Add
parserOptionswithecmaVersionandsourceType: "module"for modern JavaScript - Create a
rulesobject and add specific rules with error levels:0(off),1(warn),2(error) - For each custom rule, use the exact rule name (e.g.,
"no-console": 1) and provide an array for configuration options - Create
.eslintignorefile to exclude paths likenode_modules/,dist/, andbuild/ - Run
npx eslint . --ext .js,.jsxto test your configuration against the codebase
Code
// .eslintrc.js
module.exports = {
env: {
browser: true,
node: true,
es2021: true,
},
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
'indent': ['error', 2],
'comma-dangle': ['error', 'always-multiline'],
'no-var': 'error',
'prefer-const': 'error',
'eqeqeq': ['error', 'always'],
'curly': ['error', 'all'],
'brace-style': ['error', '1tbs'],
'no-multiple-empty-lines': ['error', { max: 2 }],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncAr
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Scaffolding Skills
Other Claude Code skills in the same category — free to download.
Next.js Starter
Scaffold Next.js project with common setup
Express Starter
Scaffold Express.js project with structure
React Starter
Scaffold React project with Vite
TypeScript Config
Set up TypeScript configuration
Prettier Config
Set up Prettier configuration
Monorepo Setup
Set up monorepo with Turborepo/Nx
Jest Config
Configure Jest testing framework
Vitest Config
Configure Vitest testing framework
Want a Scaffolding skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.