@strut-software/eslint-config
v1.8.6
Published
An opinionated collection of ESLint configs to be used across Strut and Rithm projects
Downloads
6
Readme
Lint Rules
Description
This package contains a set of ESLint configs to be used across Strut Software Solutions projects and Rithm Software projects. This is to ensure each project has the same set of rules to keep projects consistent.
Configs
Config files exist for the following use cases and are summarized below. You can mix and match these as needed and several configs inherit other configs automatically.
javascript
- Recommended rules for projects using JavaScript.typescript
- Recommended rules for projects using TypeScript.- Includes and modifies the rules from
javascript
as TypeScript is a superset of JavaScript.
- Includes and modifies the rules from
angular
- Recommended rules for projects using Angular.- Includes and modifies the rules from
typescript
andrxjs
as Angular uses TypeScript and RxJS by default.
- Includes and modifies the rules from
angular-html
- Recommended template (HTML) rules for projects using Angular.- Used in conjunction with
@angular-eslint/template-parser
.
- Used in conjunction with
rxjs
- Recommended rules for projects using the RxJS library.
Installation
From the root folder of your project, install the package with the following command:
npm i @strut-software/eslint-config --save-dev
Usage
Once the package is installed, add the desired configs to the "extends"
section of the eslintrc.json
in the root of your project:
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"@strut-software/eslint-config/angular"
],
...
}
...
]
}
Afterwards, you will be able to run your desired lint command to use the newly-imported lint rules.
NOTE: Keeping this package up to date is highly recommended. Be sure that the version number in your
package.json
contains a^
before the version number to update to the newest minor version when usingnpm update
.
Example:
"devDependencies": {
...
"@strut-software/eslint-config": "^1.1.0",
...
}
Package maintenance
Uses a token from NPM as a github secret - this secret is stored in the org level.