@xola/jslint
v3.0.2
Published
Xola's ES Lint rules to format NodeJS Javascript & Typescript code
Downloads
1,940
Keywords
Readme
ESLint Configuration
This repository serves as the source for all of Xola's ESLint configuration using XO, a pluggable ESLint wrapper. This package should be installed for every Xola React app
Required Script Commands
Add the following commands in the scripts
section of your package.json
"scripts": {
"xola-lint": "xola-lint",
"lint": "xola-lint src",
"lint:report": "xola-lint --reporter=json src > eslint_report.json && echo 'ESLint report saved to eslint_report.json'",
},
Run Tests
To run ESLint against your entire source just run
npm run lint
If you would like to run lint against a specific file then invoke the xola-lint
directly:
npm run xola-lint -- src/components/Alert.jsx
Rules
This uses the XO package along with several ES Lint rule packages customized for Xola's needs. Additionally it will use our prettier
configuration to validate other needs.
Files used:
.xo-config.json
Contains the core ESLint rules- The
prettier
key inpackage.json
contains the default prettier rules
Run npm run xola-lint --print-config .xo-config.json
to see all the rules
Fixing
You can automatically fix several violations by running:
npm run xola-lint -- <directory> --fix