Skip to content

codex-team/eslint-config

Repository files navigation

CodeX ESLint configuration

  • Flat config, ESLint 9
  • JavaScript and TypeScript configs
  • Vue.js config (TS)
  • Node.js
  • Codestyle config
  • JSDoc configs for JS and TS
  • Global variables list
  • Gitignore support

Install

Add package to your dev-dependencies using npm or yarn:

yarn add -D eslint-config-codex eslint

Usage

Add following lines to your eslint.config.mjs:

import CodeX from 'eslint-config-codex'

export default [
  ...CodeX,
  // your customization
]

VSCode suport

Open Code / Settings, find "Open Settings (JSON)" icon at the top-bar

Then fill opened .vscode/settings.json:

  // Enable the ESlint flat config support
  "eslint.experimental.useFlatConfig": true,

  // Disable the default formatter, use eslint instead
  "prettier.enable": false,
  "editor.formatOnSave": false,

  // Auto fix
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  },

  // Enable eslint for all supported languages
  "eslint.validate": [
    "javascript",
    "typescript",
    "vue",
    "html",
  ]

Troubleshooting

ESLint couldn't determine the plugin ... uniquely

Since 7.x ESLint loads plugins from the location of each config file which has the plugins field. Resolve this issue by adding the root flag to your .eslintrc config

{
  "root": true
}

Issue | Discussion