Skip to content

Latest commit

 

History

History

eslint-config

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Shared ESLint Config for Viam

This module contains Viam's shared ESLint configurations for ESLint v8.

Base config

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'],
  },
};

Svelte config

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'],
  },
};