Shared ESLint configuration used across Open Collective projects.
First, add the ESLint scripts to your package.json
:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"lint:quiet": "npm run lint -- --quiet"
}
}
Then choose your project type:
- Install dependencies:
npm install --save-dev eslint @typescript-eslint/parser eslint-plugin-import eslint-plugin-n eslint-plugin-simple-import-sort eslint-config-opencollective
- Create
.eslintrc.cjs
in your project root:
import openCollectiveConfig from 'eslint-config-opencollective/eslint-node.config.cjs';
module.exports = {
...openCollectiveConfig,
// Add your custom rules here
};
- Install dependencies:
npm install --save-dev eslint @typescript-eslint/parser eslint-plugin-import eslint-plugin-n eslint-plugin-react eslint-plugin-simple-import-sort eslint-config-opencollective
- Create
.eslintrc.cjs
in your project root:
import openCollectiveConfig from 'eslint-config-opencollective/eslint-react.config.cjs';
module.exports = {
...openCollectiveConfig,
// Add your custom rules here
};
To publish a new version:
- Update the version in
package.json
:
npm version patch # for bug fixes
npm version minor # for new features
npm version major # for breaking changes
- Push the changes and the new tag:
git push --follow-tags
- Publish to npm:
npm publish