Skip to content

vchikalkin/eslint-config-awesome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@vchikalkin/eslint-config-awesome 🎉

  • 🛠️ Most rules autofixable
  • 🎯 Designed to work with TypeScript, NextJS, React projects
  • 🏆 Powered by Canonical, SonarJS
  • ⚙️ Using ESLint Flat config

Requirements

🚀 Usage

📥 Install

pnpm add -D eslint typescript @vchikalkin/eslint-config-awesome

⚙️ Config eslint.config.js

Common usage:

const config = require('@vchikalkin/eslint-config-awesome');

/** @type {import("eslint").Linter.Config} */
module.exports = config['react-typescript'];

Extend config:

const config = require('@vchikalkin/eslint-config-awesome');

/** @type {import("eslint").Linter.Config} */
module.exports = [
  ...config['react-typescript'],
  {
    rules: {
      'rule-name': 'off',
    },
    ignores: ['node_modules'],
  },
  //...other configs
];

➕ Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

✨ Config VS Code auto fix

Install VS Code ESLint extension, VS Code Prettier extension and create .vscode/settings.json

{
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit",
    "source.fixAll.eslint": "explicit",
    "source.removeUnusedImports": "explicit"
  },
  "eslint.lintTask.enable": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "json",
    "typescript",
    "typescriptreact",
    "yaml"
  ]
}

⚙️ Config .prettierrc:

Prettier is not needed, ESLint Config Awesome🎉 includes eslint-plugin-prettier with that config:

{
  "arrowParens": "always",
  "bracketSameLine": false,
  "bracketSpacing": true,
  "endOfLine": "auto",
  "insertPragma": false,
  "jsxSingleQuote": false,
  "printWidth": 80,
  "proseWrap": "preserve",
  "quoteProps": "as-needed",
  "requirePragma": false,
  "semi": true,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "all",
  "useTabs": false
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published