Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ESLint config for Fishbrain TypeScript projects

License

NotificationsYou must be signed in to change notification settings

fishbrain/eslint-config-fishbrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base config VersionReact config Version

Usage

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",  }}

Overriding rules

Rules can be overriden in a project by editing theeslint.config.js file like so:

exportdefault[  ...config,{rules:{'@typescript-eslint/no-unsafe-assignment':'off',},},];

Ignoring files

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},];

Recommended Prettier settings

Add this topackage.json to get correct config forprettier

"prettier": {"singleQuote":true,"trailingComma":"all"  }

Browser compatibility settings

If you want to target certain browsers you can also set them inpackage.json.

"browserslist": ["chrome 70","last 1 versions","not ie <= 8"]

Releasing

  1. Runyarn workspaces foreach -A version <patch|minor|major>.
  2. Merge all changes todevelop
  3. Run/golive eslint-config-fishbrain in Slack.
  4. Merge the created go live PR.

About

ESLint config for Fishbrain TypeScript projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors15


[8]ページ先頭

©2009-2025 Movatter.jp