Skip to content

ESLint config generator for our internal and public projects. Allows to configure Vue, TypeScript, Prettier, ..., plugins.

License

Notifications You must be signed in to change notification settings

Yproximite/eslint-config-generator

Repository files navigation

ESLint config generator

Test GitHub release (latest by date)

An ESLint config generator for our internal and public projects, with Prettier, Vue, and TypeScript support.

Why?

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.

Features

Installation

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

Usage

In your .eslintrc.js:

const { generateConfig } = require('@yproximite/eslint-config-generator');

module.exports = generateConfig({
  vue: true, 
  typescript: true,
});

Vue

// 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'
  }
});

TypeScript

// 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 
  }
});

How to contribute

You need to install some dependencies first:

$ yarn

Contribution

Publishing a new release

This is automatically done by GitHub Actions and semantic-release when you merge a pull request.

About

ESLint config generator for our internal and public projects. Allows to configure Vue, TypeScript, Prettier, ..., plugins.

Resources

License

Stars

Watchers

Forks