Shared ESLint config for cheminfo and ml.js projects.
Important
Configs now require to use the ESLint Flat Config format. See the migration guide for more information.
npm i -D eslint-config-cheminfo eslint
Create a eslint.config.mjs
file with the following contents:
import cheminfo from 'eslint-config-cheminfo';
export default [...cheminfo];
You can then customize the config for your project.
Create ESLint scripts in your package.json
:
{
"scripts": {
"eslint": "eslint src",
"eslint-fix": "npm run eslint -- --fix"
}
}
This package exports three separate configurations:
eslint-config-cheminfo/base
: The base config with most rules. At least this config should be used in all projects.eslint-config-cheminfo/jsdoc
: Rules from the jsdoc plugin to help improve the documentation of our libraries.eslint-config-cheminfo/unicorn
: Additional opinionated rules selected from the unicorn plugin.
The default export from eslint-config-cheminfo
combines all of them.
https://github.com/cheminfo/eslint-config-cheminfo-typescript
https://github.com/cheminfo/eslint-config-cheminfo-react
To extend both the TypeScript and React configs, use the following template:
import typescript from 'eslint-config-cheminfo-typescript';
import react from 'eslint-config-cheminfo-react/base';
export default [...typescript, ...react];