eslint-config-flowics v13.0.0
#eslint-config-flowics
Common coding conventions for ensuring consistent style across Flowics JavaScript projects
Usage
eslint-config-flowics exports several configuration, that can be combined with each other:
lib/base: Rules only from eslint (no plugins). Several style rules & best practiceslib/promises: requireseslint-plugin-promiseplugin. Promises checks & best practiceslib/react: requireseslint-plugin-reactplugin. React checks & best practiceslib/flowtype: requireseslint-plugin-flowtypeplugin. Flowtype checks & best practiceslib/imports: requireseslint-plugin-importplugin. Checks imports. Allows to detect if you are importing a symbol that is no exported in the source module. USE IT!lib/tests: Use it to overridelib/baseto loosen up some rules in tests, and enable env jest & mocha.
To use them, just configure your .eslintrc.json as:
{
"parser": "babel-eslint",
"extends": [
"flowics/lib/base",
"flowics/lib/promises",
"flowics/lib/react",
"flowics/lib/flowtype",
"flowics/lib/imports",
"flowics/lib/tests",
]
}Just combine the ones you are interested in.
Old Usage
The old way of using this config is still available (for now), but not recommend.
You have a few presets that include several of the mentioned configs.
lib/frontend: Composesbase,promises,flowtype,imports,react& addsenv: browserlib/backend: Composesbase,promises,flowtype,imports,react& addsenv: node
Don't use them, it's better to compose the config on your own, so you only add the traits your project uses. (maybe you are not using flowtype or react, or don't care about promises rules)
Installation
Install eslint, the config, and the required plugins
yarn add --dev eslint babel-eslint eslint-config-flowics eslint-config-prettierOptionally, if you use the imports config, also do:
yarn add --dev eslint-plugin-importOptionally, if you use the react config, also do:
yarn add --dev eslint-plugin-reactOptionally, if you use the promise config, also do:
yarn add --dev eslint-plugin-promiseOptionally, if you use the flowtype config, also do:
yarn add --dev eslint-plugin-flowtypeTo publish a new version
Run
npm publishAnd answer the questions!