0.3.0 • Published 3 years ago

@esvelo/eslint-config v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@esvelo/eslint-config

Suggested defaults for both ESlint and Prettier. Feel free to customize it on project-by-project basis.

How to install

1️⃣. Add dependencies to your project

yarn add -D @esvelo/eslint-config eslint prettier

2️⃣. Create or extend config files

See .eslintrc.js, .prettierrc.js and tsconfig.json in monorepository root. Adding .editorconfig and .prettierignore is also strongly encouraged.

3️⃣. Add lint to scripts in package.json

{
  "scripts": {
    …
    "lint": "prettier --write . && eslint --fix --ext .js,.ts,.tsx,.json .",
    "test:lint": "prettier --check . && eslint --ext .js,.ts,.tsx,.json ."
  }
}

Customize rules

ESlint

It's easy to change or override rules.

⚠️ If you change monorepository org, adjust:

{
  settings: {
    'import/internal-regex': '^@your-custom-org-name/',
  },
}

Prettier

Options are available on prettier.io/docs/en/options.html

// .prettierrc.js

const config = require('@esvelo/eslint-config/prettier')

module.exports = {
  ...config,
  semi: true,
}

🧭 Plans for the future

🔌 Plugins to add or evaluate

  • eslint-plugin-node
  • eslint-plugin-security
  • eslint-plugin-eslint-comments
  • eslint-plugin-react-native

🛠️ Custom rules

ESlint plugins are based on AST parsing. In case you find any atypical case where eslint could help, there is a possibility to change this config into plugin with custom rules.