@dethdkn/eslint-config
@dethdkn/eslint-config
๐งน My Opinionated ESLint Config
๐ฆ About This Package
This is my opinionated eslint-config, heavily inspired by Antfu's config. This setup is a combination of the following rules:
-
HTML (hbs)
-
Javascript
-
Node
-
Import X
-
Unused Imports
-
Promise
-
Security
-
De Morgan
-
Eslint Comments
-
JSDoc
-
Antfu
-
Drizzle
-
Zod
-
Typescript
-
Stylistic
-
CSS
-
Regexp
-
Perfectionist
-
Unicorn
-
Vitest
-
Json
-
SVGO
-
Yaml
-
Toml
-
TailwindCSS*
-
Vue*
-
vue-a11y*
-
vue-i18n*
-
Nuxt*
-
React*
-
React-i18n*
-
Next*
- And more...
*Not enabled by default
Click here to check all rules
๐ Setup
-
Install with your favorite package manager:
- pnpm :
pnpm add -D eslint @dethdkn/eslint-config - npm :
npm i -D eslint @dethdkn/eslint-config - yarn :
yarn add -D eslint @dethdkn/eslint-config - bun :
bun add -D eslint @dethdkn/eslint-config
- pnpm :
-
Create a
eslint.config.mjsin the project root:
// eslint.config.mjs
import dethdkn from '@dethdkn/eslint-config'
export default dethdkn()
- Add lint scripts to
package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
- Add the following configuration to
.vscode/settings.json:
{
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"handlebars",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
โ๏ธ Options
tailwind,vue,nuxt,vueI18n,react,next,reactI18n,autoImportsrules can be enabled:
// eslint.config.mjs
import dethdkn from '@dethdkn/eslint-config'
export default dethdkn({ tailwind: true, vue: true, nuxt: true, vueI18n: true, react: true, next: true, reactI18n: true, autoImports: true }, {whiteListClasses: [], i18nIgnores: [], fullPackageJson: true})
๐ License
Copyright ยฉ 2024 Gabriel 'DethDKN' Rosa
This project is under MIT license
Related Packages
Reusable ESLint flat configs for TypeScript, React, Vitest, Vue, Tailwind CSS, a...
Shared ESLint flat config for Vasek's Vue/Nuxt/TS projects. Wraps @antfu/eslint-...
Dead Code Checker is a tool for finding dead code in your JavaScript or TypeScri...
Themex aims to prevent a blank screen in your IDE and serves as a solid foundati...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 4.0.3 | MIT | ||
| 4.0.2 | MIT | ||
| 4.0.1 | MIT | ||
| 4.0.0 | MIT | ||
| 3.3.5 | MIT | ||
| 3.3.4 | MIT | ||
| 3.3.3 | MIT | ||
| 3.3.2 | MIT | ||
| 3.3.1 | MIT | ||
| 3.3.0 | MIT | ||
| 3.2.0 | MIT | ||
| 3.1.0 | MIT | ||
| 3.0.3 | MIT | ||
| 3.0.2 | MIT | ||
| 3.0.1 | MIT | ||
| 3.0.0 | MIT | ||
| 2.4.0 | MIT | ||
| 2.3.2 | MIT | ||
| 2.3.1 | MIT | ||
| 2.3.0 | MIT | ||
| 2.2.1 | MIT | ||
| 2.2.0 | MIT | ||
| 2.1.0 | MIT | ||
| 2.0.3 | MIT | ||
| 2.0.2 | MIT | ||
| 2.0.1 | MIT | ||
| 2.0.0 | MIT | ||
| 1.9.2 | ^3.5.13 | MIT | |
| 1.9.1 | ^3.5.13 | MIT | |
| 1.9.0 | ^3.5.13 | MIT |
Showing the latest 30 of 69. See every release on npm
Pre-releases (10)
| Version | Released | License |
|---|---|---|
| 4.0.0-beta.10 | MIT | |
| 4.0.0-beta.9 | MIT | |
| 4.0.0-beta.8 | MIT | |
| 4.0.0-beta.7 | MIT | |
| 4.0.0-beta.6 | MIT | |
| 4.0.0-beta.5 | MIT | |
| 4.0.0-beta.4 | MIT | |
| 4.0.0-beta.3 | MIT | |
| 4.0.0-beta.2 | MIT | |
| 4.0.0-beta.1 | MIT |