ESLint shareable config for the UdeS JavaScript style guide.
npm install eslint-config-udes --save-dev
Our default export use some plugins that you need to install as well:
npm install prettier eslint-plugin-prettier eslint-plugin-json-format eslint-plugin-markdown --save-dev
- Add the extends attribute to your
.eslintrc.js
:
module.exports = {
// Extends the UdeS ESLint config
extends: 'eslint-config-udes',
// Limit ESLint to a specific project
root: true,
};
- Add the wanted scripts to your
package.json
:
{
"scripts": {
"format": "npm run lint -- --fix",
"lint": "eslint . --ext js,json,md"
}
}
- If you use one of the supported language/framework, you should use the corresponding extends in your
.eslintrc.js
:
module.exports = {
// Extends the UdeS ESLint config for lit-html application
extends: 'eslint-config-udes/lit-html',
// Extends the UdeS ESLint config for Node.js 16 application
extends: 'eslint-config-udes/node-16',
// Extends the UdeS ESLint config for React application and element
extends: 'eslint-config-udes/react',
};
As these configurations use other plugins, you may need to install additional devDependencies:
# lit-html
npm install babel-eslint eslint-plugin-html eslint-plugin-lit --save-dev
# React
npm install eslint-plugin-react --save-dev
Increment the version
defined in the package.json
file and run the command below to publish the module in the
registry:
# Dry run
npm publish --dry-run
# For real (are you really sure?)
npm publish
The MIT License (MIT)