@shaizei/eslint-config v0.1.0-beta.13
Getting Started
1. Installation
Using Yarn:
yarn add @shaizei/eslint-config --devUsing npm:
npm install @shaizei/eslint-config --save-dev2. Usage
- Create a new file and name it as
.eslintrc.js - Import relevant config file from
@shaizei/eslint-configand just export it as follows.
For JavaScript projects:
module.exports = {
extends: '@shaizei/eslint-config/javascriptReact',
};For TypeScript projects:
module.exports = {
extends: '@shaizei/eslint-config/typescriptReact',
};- In order to have a
.eslintignorefile as well, just run the following command from terminal:
cat ./node_modules/@shaizei/eslint-config/.eslintignore >> .eslintignoreOverride Default Config
If you want to override the default configuration, then add the following code in .eslintrc.js file:
For JavaScript projects:
module.exports = {
extends: '@shaizei/eslint-config/javascriptReact',
// your config options goes here, e.g. plugins: [...]
};For TypeScript projects:
module.exports = {
extends: '@shaizei/eslint-config/typescriptReact',
// your config options goes here, e.g. plugins: [...]
};VSCode ESLint Extension Setup
As we're not installing ESLint locally per project, but leveraging ESLint and associated packages installed in @shaizei/eslint-config project. Thus, we need to inform VSCode ESLint extension that how to resolve ESLint.
Go to
settings.jsonin VSCode.Add following settings:
"eslint.nodePath": "./node_modules/@shaizei/eslint-config/node_modules"Above mentioned settings will let the extension read ESLint from @shaizei/eslint-config.
Also, for TypeScript, we need to tell ESLint extension to lint .ts and .tsx files as well. We recommend to add following setting as well in settings.json:
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago