@osufrlive/eslint-config
ESLint config for osu!frlive projects.
Usage
Tested on npm 7+. Peer dependencies behavior change often in between major releases.
- Install as a development dependency:
npm i -D @osufrlive/eslint-config
- Paste in .eslintrc.js:
module.exports = {
root: true,
extends: [
"@osufrlive",
],
};
- Add the following script to
package.json
:
"lint": "eslint --ext .js,.ts src/"
Tip to allow linting entire repository
Files never included in the TypeScript context (such as .eslintrc.js) may error out with:
/home/thepoon/Documents/git/osufrlive/form-auth/.eslintrc.js
0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.js.
The file must be included in at least one of the projects provided
Suggested work-around:
- Create a new
tsconfig.eslint.json
file with:
{
"extends": "./tsconfig.json",
"include": [
".eslintrc.js",
],
}
- Override
parserOptions.project
in.eslintrc.js
, eg.:
module.exports = {
root: true,
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.eslint.json"],
},
extends: [
"@osufrlive",
],
};
Upgrading
If upgrading from 0.0.x:
- Remove any peer dependencies introduced by the package
- Remove the package
- Reinstall the package
- Update .eslintrc.js (see above)