Skip to content

studiometa/eslint-config

Repository files navigation

@studiometa/eslint-config

NPM Version Downloads Size Dependency Status

Set of ESLint configurations for multiple usages.

Installation

Install the package with NPM along ESLint and Prettier:

npm install --save-dev eslint prettier @studiometa/eslint-config

Usage

To use the basic configuration, you just have to install this package and reference it in your ESLint configuration file:

import { defineConfig, js, prettier, globals } from '@studiometa/eslint-config';

export default defineConfig(js, prettier, {
  files: ['./src/js/**/*.js'],
  languageOptions: {
    globals: {
      ...globals.browser,
    },
  },
});

Make sure to always place the prettier configuration last to avoid rules conflicts.

Configurations for Vue 2, Vue 3 and TypeScript are also available:

Vue 3

import { defineConfig, js, vue, prettier, globals } from '@studiometa/eslint-config';

export default defineConfig(js, vue, prettier, {
  files: ['./src/js/**/*.{js,vue}'],
  languageOptions: {
    globals: {
      ...globals.browser,
    },
  },
});

TypeScript

import { defineConfig, ts, prettier, globals } from '@studiometa/eslint-config';

export default defineConfig(ts, prettier, {
  files: ['./src/js/**/*.ts'],
  languageOptions: {
    globals: {
      ...globals.browser,
    },
  },
});

Vue 3 × TypeScript

import { defineConfig, ts, vueTs, prettier, globals } from '@studiometa/eslint-config';

export default defineConfig(ts, vueTs, prettier, {
  files: ['./src/js/**/*.{ts,vue}'],
  languageOptions: {
    globals: {
      ...globals.browser,
    },
  },
});