An ESLint config generator for our internal and public projects, with Prettier, Vue, and TypeScript support.
The primary goal of this configuration generator is to have the same and adaptable configuration on all of our projects.
In this way, we reduce time and energy costs while maintaining +150 lines of ESLint configuration (for the biggest) accross multiple projects.
- Use eslint-config-airbnb-base
- Use Prettier with eslint-plugin-prettier and eslint-config-prettier
- Support Vue, with eslint-plugin-vue with some opinionated rules
- Support TypeScript, with @typescript-eslint/plugin-eslint with some opinionated rules
This package is hosted on GitHub Packages, so you must tell to npm/yarn where to download it. Please read Authenticating to GitHub Packages.
You can run npm login --registry=https://npm.pkg.github.com --scope=@yproximite
or create a .npmrc
file with the following content:
@yproximite:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<access token>
Then run:
$ yarn add --dev @yproximite/eslint-config-generator eslint@^7.0.0 @babel/eslint-parser@^7.0.0 prettier@^2.0.0
In your .eslintrc.js
:
const { generateConfig } = require('@yproximite/eslint-config-generator');
module.exports = generateConfig({
vue: true,
typescript: true,
});
// enable Vue support
generateConfig({
vue: true
});
// enable and configure Vue support
generateConfig({
vue: {
version: 3, // default: 2
config: 'recommended', // default: 'recommended', available values: 'essential', 'recommended', 'strongly-recommended'
}
});
// enable TypeScript support
generateConfig({
typescript: true
});
// enable and configure TypeScript support
generateConfig({
typescript: {
vueComponents: true, // allow to lint .vue files, enabled by default if Vue support is enabled
}
});
You need to install some dependencies first:
$ yarn
- Make a pull request, its title should follows Angular commit message convention
- You should Squash and Merge your pull request
This is automatically done by GitHub Actions and semantic-release when you merge a pull request.