altheajs-eslint-config
Althea Web Service's eslint
configuration.
You can view this package on NPM: click here
Installation
npm
npm install --save-dev altheajs-eslint-config
yarn
yarn add --dev altheajs-eslint-config
Usage
Configuration
The simplest way to install and use the default config is to reference it directly in your package.json
file as follows:
{
"eslintConfig": {
"extends" : "altheajs-eslint-config"
}
}
If you'd like to extend the configurations, create a .eslintrc.js
file at the root of your project that contains:
module.exports = {
"extends": ["altheajs-eslint-config"],
"parserOptions": { "project": "./tsconfig.json" }
};
NPM Scripts Command
You can add in an npm script to your package.json
which will apply lint rules across all the file patterns specified. Simply add the following to apply to all files:
{
"scripts": {
"lint:quality": "npx eslint -c .eslintrc.js . --ext .js,.jsx,.ts,.tsx"
"fix:quality": "npx eslint -c .eslintrc.js . --ext .js,.jsx,.ts,.tsx --fix",
}
}
Visual Studio Code
-
Install ESLint extension: View → Extensions
then find and install the ESLint extension.
-
Reload the editor.
-
In your user settings Code -> Preferences -> Settings
add the following settings:
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
Enforced Rules
Check out all of ESlint's configuration options.