Skip to content

ESLint shareable config for the UdeS JavaScript style guide

License

Notifications You must be signed in to change notification settings

UdeS-STI/eslint-config-udes

Repository files navigation

eslint-config-udes

npm Known Vulnerabilities CircleCI

ESLint shareable config for the UdeS JavaScript style guide.

Installation

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

Usage (by default)

  • 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,
};

Scripts

  • Add the wanted scripts to your package.json:
{
  "scripts": {
    "format": "npm run lint -- --fix",
    "lint": "eslint . --ext js,json,md"
  }
}

Supported languages/frameworks

  • 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',
};

Installation

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

Publish

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

License

The MIT License (MIT)