This package includes the shareable ESLint configuration used by SF-Tech.
Please refer to its documentation:
If you want to use this ESLint configuration in your project, you can install it with the following steps.
First, install this package, ESLint and the necessary plugins.
npm install --save-dev eslint-config-sf-react babel-eslint@9.x eslint@5.x eslint-plugin-flowtype@2.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x
or
yarn add --dev eslint-config-sf-react babel-eslint@9.x eslint@5.x eslint-plugin-flowtype@2.x eslint-plugin-import@2.x eslint-plugin-jsx-a11y@6.x eslint-plugin-react@7.x
Then create a file named .eslintrc
with following contents in the root folder of your project:
{
"extends": "sf-react"
}
If you want, you can also create a file named .prettierrc
with following contents in the root folder of your project:
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"jsxBracketSameLine": false,
"endOfLine": "lf",
"jsxSingleQuote": true
}
That's it! You can override the settings from eslint-config-sf-react
by editing the .eslintrc
file. Learn more about configuring ESLint on the ESLint website.
If you want to enable even more accessibility rules, you can create an .eslintrc
file in the root of your project with this content:
{
"extends": ["sf-js", "sf-react", "sf-vue", "sf-ts", "sf-mp"],
"plugins": ["sf-plugin"]
}