Set of ESLint configurations for multiple usages.
Install the package with NPM along ESLint and Prettier:
npm install --save-dev eslint prettier @studiometa/eslint-config
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,
},
},
});