Opinionated ESLint shareable configs.
Ruleset | Description |
---|---|
core | Core rules |
typescript | TypeScript rules |
node/script | Node.js rules in "script" mode |
node/module | Node.js rules in "module" mode |
node/module/typescript | Node.js rules in "module" mode using TypeScript |
jest | Jest rules |
browser | Browser rules |
react | React rules |
react/typescript | React rules using TypeScript |
jsdoc | JSDoc rules |
json | JSON rules |
graph TD;
core --> browser & node/script & node/module
browser --> react
react --> react/typescript
node/module --> jest & node/module/typescript
jsdoc
json
typescript
$ npm install @valtech-commerce/eslint-config
Add some ESLint config to your .eslintrc.yaml
:
extends: "@valtech-commerce/eslint-config/[RULESET]"
- eslint-plugin-unicorn - Various awesome rules
- eslint:recommended - Recommended rules by ESLint.
- unicorn/recommended - Recommended rules by unicorn.
- eslint-config-prettier - Turns off all rules that are unnecessary or might conflict with Prettier.
parserOptions:
project:
- "./tsconfig.json" # Your TS config file
- @typescript-eslint/parser - TypeScript parser
- @typescript-eslint - TypeScript linting rules
- @typescript-eslint/recommended - Recommended rules for TypeScript
- @typescript-eslint/recommended-requiring-type-checking - Require type information rules
- eslint-plugin-node - Additional ESLint's rules for Node.js
- node/recommended-script - Recommended rules for Node.js with CommonJS.
- eslint-plugin-node - Additional ESLint's rules for Node.js
- node/recommended-module - Recommended rules for Node.js with ESM.
- import/recommended - Recommended rules for Import.
settings:
import/resolver:
typescript:
project: "./tsconfig.json" # Your TS config file
- import/typescript - TypeScript support.
- eslint-plugin-jest - Jest syntax rules
- jest/recommended - Recommended rules for Jest
- jest/style - Style rules for Jest
- @babel/eslint-parser - For flow
- eslint-plugin-import - import/export syntax rules
- eslint-plugin-jsx-a11y - Accessibility rules on JSX elements
- eslint-plugin-ordered-imports - Sorting and grouping imports
- eslint-plugin-react - React
- eslint-plugin-react-hooks - Enforces rules for React Hooks
- airbnb - Airbnb JavaScript Style Guide
- airbnb/hooks - Airbnb JavaScript Style Guide for hooks
- eslint-plugin-jsdoc - JSDoc linting rules
- jsdoc/recommended - Recommended rules for JSDoc
- eslint-plugin-json - ESLint plugin for JSON files
- json/recommended - Recommended rules for JSON
See the Changelog to see what has changed.
See the Contributing Guidelines for ways to get started.
See the Support Guide for ways to get help.
See the Security Policy for sharing vulnerability reports.
This project has a Code of Conduct. By interacting with this repository, organization, or community you agree to abide by its terms.