@valtech-commerce/eslint-config
v4.0.0
Published
Valtech_Commerce ESLint configurations
Downloads
547
Readme
@valtech-commerce/eslint-config
Opinionated ESLint shareable configs.
Rulesets
| 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 |
Dependency tree
graph TD;
core --> browser & node/script & node/module
browser --> react
react --> react/typescript
node/module --> jest & node/module/typescript
jsdoc
json
typescript
Install
$ npm install @valtech-commerce/eslint-config
Usage
Add some ESLint config to your .eslintrc.yaml
:
extends: "@valtech-commerce/eslint-config/[RULESET]"
Specifications
core
Used plugins / configuration
- 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.
typescript
Add your tsconfig file to your .eslintrc.yaml
:
parserOptions:
project:
- "./tsconfig.json" # Your TS config file
Used parser / plugin / configuration
- @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
node/script
Used plugin / configuration
- eslint-plugin-node - Additional ESLint's rules for Node.js
- node/recommended-script - Recommended rules for Node.js with CommonJS.
node/module
Used plugin / configuration
- 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.
node/module/typescript
Add your tsconfig file to your .eslintrc.yaml
:
settings:
import/resolver:
typescript:
project: "./tsconfig.json" # Your TS config file
Used configuration
- import/typescript - TypeScript support.
jest
Used plugin / configuration
- eslint-plugin-jest - Jest syntax rules
- jest/recommended - Recommended rules for Jest
- jest/style - Style rules for Jest
react
Used parser / plugin / configuration
- @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
jsdoc
Used plugin / configuration
- eslint-plugin-jsdoc - JSDoc linting rules
- jsdoc/recommended - Recommended rules for JSDoc
json
Used plugin / configuration
- eslint-plugin-json - ESLint plugin for JSON files
- json/recommended - Recommended rules for JSON
Documentation
See the Changelog to see what has changed.
Contribute
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.