3.0.0 • Published 24 days ago

eslint-config-moneyforward v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days ago

eslint-config-moneyforward

Version License

This package provides moneyforward's .eslintrc as an extensible shared config.

Usage

1. Install dependencies (and peer dependencies)

npm install --save-dev eslint-config-moneyforward eslint

2. Configure ESLint

Within your ESLint config file:

{
  "extends": ["moneyforward/essentials"]
}

If you need React Support:

{
  "extends": [
    "moneyforward/essentials",
+   "moneyforward/react",
  ]
}

Must be added after essentials.

We also provide various other rule sets that you can configure to suit your project.

{
  "extends": [
    "moneyforward/essentials",
    "moneyforward/jsdoc",
    "moneyforward/next",
    "moneyforward/node",
    "moneyforward/react",
    "moneyforward/storybook",
    "moneyforward/test/react",
    "moneyforward/typescript"
  ]
}
Rule setSummaryDependencies
essentialsContains basic, import, and promise recommended ruleseslint eslint-plugin-promise eslint-plugin-import
jsdocContains JSDoc recommended ruleseslint-plugin-jsdoc
nextContains Next.js recommended ruleseslint-plugin-next
nodeContains Node.js recommended ruleseslint-plugin-n
reactContains React recommended ruleseslint-plugin-jsx-a11y eslint-plugin-react-hooks eslint-plugin-react
storybookContains Storybook recommended ruleseslint-plugin-storybook
test/reactContains Jest and React Testing Library ruleseslint-plugin-jest eslint-plugin-testing-library
typescriptContains TypeScript recommended rules@eslint-typescript/eslint-plugin @eslint-typescript/parser

Using Prettier

If you use Prettier to format your code, you must disable any rules in moneyforward/essentials that conflict with Prettier.

1. Install dependencies

npm install --save-dev eslint-config-prettier

2. Configure ESLint

Within your ESLint config file:

{
  "extends": [
    "moneyforward/essentials",
    "moneyforward/react",
+   "prettier"
  ]
}

By adding the prettier configuration to extends in the ESLint configuration, you can disable all rules in moneyforward/essentials that conflict with Prettier.

Versioning

  • Increment major version: Changed error rules.
  • Increment minor version: Changed warn rules.
  • Increment patch version: Not changed error and warn rules.

License

Open source licensed as MIT.