- Notifications
You must be signed in to change notification settings - Fork0
ESLint config for Fishbrain TypeScript projects
License
fishbrain/eslint-config-fishbrain
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Install the dependency:
yarn add -D @fishbrain/eslint-config-base# Or, for React projectsyarn add -D @fishbrain/eslint-config-react
Create a file in the root of your project namedeslint.config.js
, oreslint.config.mjs
if ESM is not enabled.Populate it with the following content:
import{config,looseTypes,configWithoutJest}from'@fishbrain/eslint-config-base';exportdefault[ ...config,// or configWithoutJest if the project doesn't use Jest. ...looseTypes,// Use this if the project is poorly typed.];
You can run linting with a script inpackage.json
. Note that we reference ESLint fromnode_modules
directlyas it's installed as a dependency of our config and is not available by callingeslint
:
{"scripts": {"lint":"node_modules/.bin/eslint src some_other_dir some_file.js", }}
Rules can be overriden in a project by editing theeslint.config.js
file like so:
exportdefault[ ...config,{rules:{'@typescript-eslint/no-unsafe-assignment':'off',},},];
You can ignore files using a glob pattern. Note that the ignores object needs to be on its own without other rules tobe applied globally to all rules.
exportdefault[{ignores:['src/__generated__/**/*','setupTests.js'],}, ...config,{// Other custom rules and config},];
Add this topackage.json
to get correct config forprettier
"prettier": {"singleQuote":true,"trailingComma":"all" }
If you want to target certain browsers you can also set them inpackage.json
.
"browserslist": ["chrome 70","last 1 versions","not ie <= 8"]
- Run
yarn workspaces foreach -A version <patch|minor|major>
. - Merge all changes to
develop
- Run
/golive eslint-config-fishbrain
in Slack. - Merge the created go live PR.
About
ESLint config for Fishbrain TypeScript projects
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Uh oh!
There was an error while loading.Please reload this page.
Contributors15
Uh oh!
There was an error while loading.Please reload this page.