@xola/jslint
v4.1.2
Published
Sharable ESLint configuration for Xola's Javascript & Typescript code
Keywords
Readme
ESLint Configuration
This repository is Xola's shared ESLint rules only. It ships a flat
config (a rule set) that host projects extend. It does not provide a linter binary or CLI, and
it is not a replacement for ESLint itself. Each host project installs and runs its own eslint
(and typescript for the type-aware rules); this package only supplies the rules they use.
Two configs are exported: the default/. config for React projects, and ./node for plain
Node/TypeScript projects with no React.
Installation
Install the @xola/jslint package as a devDependency in your host project, alongside eslint and
typescript, which are peer dependencies you provide.
npm install -D @xola/jslint eslint typescriptSetup
To use the shared config, import the package inside of an eslint.config.mjs file and add it into the exported array, like this:
// eslint.config.mjs
import xolaLint from "@xola/jslint";
export default [...xolaLint];Then lint with ESLint directly in your host project's scripts (this package does not wrap it):
{
"scripts": {
"lint": "eslint --cache --cache-strategy content --fix src",
"lint:ci": "eslint --cache --cache-strategy content src",
"lint:report": "eslint --cache --cache-strategy content --output-file=eslint_report.json --format=json src"
}
}Overriding settings from the shared config
You can override settings from the shareable config by adding them directly into your eslint.config.mjs file after importing the shareable config. For example:
// eslint.config.mjs
import xolaLint from "@xola/jslint";
export default [
...xolaLint,
// anything from here will override xolaLint
{
rules: {
"no-unused-vars": "error",
},
},
];Disabling the progress output
Linting prints a Processed N files... line as it runs. Set XOLA_LINT_PROGRESS to off, false, or 0 to
turn it off:
XOLA_LINT_PROGRESS=off npx eslintIt is also off automatically when NODE_ENV=ci and whenever stdout is not a terminal, so eslint -f json,
rtk lint eslint, and redirected log files stay parseable.
