This module contains Viam's shared ESLint configurations for ESLint v8.
Use the base config for vanilla JavaScript / TypeScript projects. Be sure to add your tsconfig.json
files to parserOptions.project
and settings['import/resolver'].typescript.project
.
pnpm add --save-dev \
@viamrobotics/eslint-config \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin \
eslint \
eslint-config-prettier \
eslint-plugin-unicorn \
eslint-plugin-vitest
// .eslintrc.cjs
'use strict';
module.exports = {
root: true,
extends: ['@viamrobotics/eslint-config'],
parserOptions: {
project: ['./tsconfig.json'],
},
};
Use the Svelte config for Svelte projects.
pnpm add --save-dev \
@viamrobotics/eslint-config \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin \
eslint \
eslint-config-prettier \
eslint-plugin-jest-dom \
eslint-plugin-svelte \
eslint-plugin-tailwindcss \
eslint-plugin-testing-library \
eslint-plugin-unicorn \
eslint-plugin-vitest
// .eslintrc.cjs
'use strict';
module.exports = {
root: true,
extends: ['@viamrobotics/eslint-config/svelte'],
parserOptions: {
project: ['./tsconfig.json'],
},
};