New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@viamrobotics/eslint-config

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@viamrobotics/eslint-config - npm Package Compare versions

Comparing version

to
1.0.0

typings/eslint-config-prettier.d.ts

266

dist/eslint-config.d.ts

@@ -1,258 +0,8 @@

export declare let parser: string;
export declare let plugins: string[];
declare let _extends: string[];
export { _extends as extends };
export declare namespace parserOptions {
let sourceType: string;
let ecmaVersion: string;
}
export declare let rules: {
'accessor-pairs': string[];
'array-callback-return': (string | {
checkForEach: boolean;
})[];
camelcase: (string | {
properties: string;
ignoreImports: boolean;
})[];
'class-methods-use-this': string[];
curly: string[];
'default-case-last': string[];
'default-param-last': string[];
eqeqeq: (string | {
null: string;
})[];
'func-names': string;
'func-style': string;
'grouped-accessor-pairs': string;
'guard-for-in': string;
'id-length': (string | {
exceptions: string[];
})[];
'line-comment-position': string;
'lines-between-class-members': (string | {
exceptAfterSingleLine: boolean;
})[];
'logical-assignment-operators': string;
'max-depth': string;
'max-nested-callbacks': string;
'max-statements-per-line': string;
'new-cap': string;
'no-alert': string;
'no-await-in-loop': string;
'no-bitwise': string;
'no-caller': string;
'no-console': string;
'no-constant-binary-expression': string;
'no-constructor-return': string;
'no-debugger': string;
'no-div-regex': string;
'no-else-return': string;
'no-empty-static-block': string;
'no-eval': string;
'no-extend-native': string;
'no-extra-bind': string;
'no-extra-label': string;
'no-implicit-coercion': string;
'no-implicit-globals': string;
'no-invalid-this': string;
'no-iterator': string;
'no-label-var': string;
'no-labels': string;
'no-lone-blocks': string;
'no-lonely-if': string;
'no-loop-func': string;
'no-multi-assign': string;
'no-multi-str': string;
'no-nested-ternary': string;
'no-new': string;
'no-new-func': string;
'no-new-native-nonconstructor': string;
'no-new-object': string;
'no-new-wrappers': string;
'no-octal-escape': string;
'no-param-reassign': string;
'no-plusplus': string;
'no-promise-executor-return': string;
'no-proto': string;
'no-return-assign': string;
'no-script-url': string;
'no-self-compare': string;
'no-sequences': string;
'no-shadow': string;
'no-template-curly-in-string': string;
'no-unneeded-ternary': string;
'no-unreachable-loop': string;
'no-underscore-dangle': (string | {
allow: string[];
})[];
'no-unmodified-loop-condition': string;
'no-unused-expressions': string;
'no-unused-private-class-members': string;
'no-useless-call': string;
'no-useless-computed-key': string;
'no-useless-concat': string;
'no-useless-rename': string;
'no-useless-return': string;
'no-var': string;
'no-void': (string | {
allowAsStatement: boolean;
})[];
'object-shorthand': string[];
'one-var': string[];
'operator-assignment': string;
'padding-line-between-statements': string;
'prefer-arrow-callback': string;
'prefer-const': string;
'prefer-exponentiation-operator': string;
'prefer-named-capture-group': string;
'prefer-numeric-literals': string;
'prefer-object-has-own': string;
'prefer-object-spread': string;
'prefer-promise-reject-errors': string;
'prefer-regex-literals': string;
'prefer-rest-params': string;
'prefer-spread': string;
'prefer-template': string;
radix: string;
'require-unicode-regexp': string;
'require-atomic-updates': string;
'spaced-comment': (string | {
markers: string[];
})[];
strict: string;
'symbol-description': string;
'vars-on-top': string;
yoda: string;
'@typescript-eslint/return-await': string;
'@typescript-eslint/no-confusing-void-expression': (string | {
ignoreArrowShorthand: boolean;
})[];
'@typescript-eslint/no-import-type-side-effects': string[];
'@typescript-eslint/no-shadow': string[];
'@typescript-eslint/no-unused-vars': (string | {
argsIgnorePattern: string;
varsIgnorePattern: string;
})[];
'@typescript-eslint/no-use-before-define': (string | {
functions: boolean;
classes: boolean;
variables: boolean;
allowNamedExports: boolean;
ignoreTypeReferences: boolean;
})[];
'@typescript-eslint/promise-function-async': string;
'@typescript-eslint/restrict-template-expressions': (string | {
allowAny: boolean;
allowBoolean: boolean;
allowNever: boolean;
allowNullish: boolean;
allowNumber: boolean;
allowRegExp: boolean;
})[];
'simple-import-sort/imports': (string | {
groups: string[][];
})[];
'simple-import-sort/exports': string;
'unicorn/custom-error-definition': string;
'unicorn/no-null': string;
'unicorn/no-unused-properties': string;
'unicorn/no-useless-undefined': string;
'unicorn/prefer-string-replace-all': string;
'unicorn/prefer-top-level-await': string;
'unicorn/prevent-abbreviations': string;
};
export declare let overrides: ({
files: string[];
parserOptions: {
sourceType: string;
};
env: {
commonjs: boolean;
};
rules: {
'@typescript-eslint/no-require-imports': string;
'@typescript-eslint/no-unsafe-member-access': string;
'@typescript-eslint/no-unsafe-call': string;
'@typescript-eslint/no-unsafe-assignment': string;
'@typescript-eslint/no-var-requires': string;
'@typescript-eslint/no-non-null-assertion'?: never;
'@typescript-eslint/restrict-template-expressions'?: never;
'unicorn/consistent-function-scoping'?: never;
'vitest/consistent-test-filename'?: never;
'vitest/consistent-test-it'?: never;
'vitest/no-conditional-expect'?: never;
'vitest/no-conditional-in-test'?: never;
'vitest/no-conditional-tests'?: never;
'vitest/no-restricted-matchers'?: never;
'vitest/no-restricted-vi-methods'?: never;
'vitest/prefer-each'?: never;
'vitest/require-top-level-describe'?: never;
'vitest/valid-expect'?: never;
'@typescript-eslint/no-empty-interface'?: never;
};
extends?: never;
} | {
files: string[];
extends: string[];
rules: {
'@typescript-eslint/no-non-null-assertion': string;
'@typescript-eslint/no-unsafe-assignment': string;
'@typescript-eslint/restrict-template-expressions': string;
'unicorn/consistent-function-scoping': string;
'vitest/consistent-test-filename': (string | {
pattern: string;
})[];
'vitest/consistent-test-it': (string | {
fn: string;
})[];
'vitest/no-conditional-expect': string;
'vitest/no-conditional-in-test': string;
'vitest/no-conditional-tests': string;
'vitest/no-restricted-matchers': (string | {
toBeFalsey: string;
toBeTruthy: string;
})[];
'vitest/no-restricted-vi-methods': (string | {
spyOn: string;
})[];
'vitest/prefer-each': string;
'vitest/require-top-level-describe': string;
'vitest/valid-expect': (string | {
maxArgs: number;
})[];
'@typescript-eslint/no-require-imports'?: never;
'@typescript-eslint/no-unsafe-member-access'?: never;
'@typescript-eslint/no-unsafe-call'?: never;
'@typescript-eslint/no-var-requires'?: never;
'@typescript-eslint/no-empty-interface'?: never;
};
parserOptions?: never;
env?: never;
} | {
files: string;
rules: {
'@typescript-eslint/no-empty-interface': string;
'@typescript-eslint/no-require-imports'?: never;
'@typescript-eslint/no-unsafe-member-access'?: never;
'@typescript-eslint/no-unsafe-call'?: never;
'@typescript-eslint/no-unsafe-assignment'?: never;
'@typescript-eslint/no-var-requires'?: never;
'@typescript-eslint/no-non-null-assertion'?: never;
'@typescript-eslint/restrict-template-expressions'?: never;
'unicorn/consistent-function-scoping'?: never;
'vitest/consistent-test-filename'?: never;
'vitest/consistent-test-it'?: never;
'vitest/no-conditional-expect'?: never;
'vitest/no-conditional-in-test'?: never;
'vitest/no-conditional-tests'?: never;
'vitest/no-restricted-matchers'?: never;
'vitest/no-restricted-vi-methods'?: never;
'vitest/prefer-each'?: never;
'vitest/require-top-level-describe'?: never;
'vitest/valid-expect'?: never;
};
parserOptions?: never;
env?: never;
extends?: never;
})[];
export type ConfigArray = import("@typescript-eslint/utils").TSESLint.FlatConfig.ConfigArray;
/**
* @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray} ConfigArray
*/
/** @type {ConfigArray} */
export const baseConfig: ConfigArray;
export const createConfig: typeof ts.config;
import ts from 'typescript-eslint';

@@ -1,272 +0,303 @@

'use strict';
import js from '@eslint/js';
import vitest from '@vitest/eslint-plugin';
import prettier from 'eslint-config-prettier';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import ts from 'typescript-eslint';
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'simple-import-sort'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:unicorn/recommended',
'prettier',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
const createConfig = ts.config;
/**
* @typedef {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray} ConfigArray
*/
/** @type {ConfigArray} */
const baseConfig = createConfig(
js.configs.recommended,
ts.configs.strictTypeChecked,
ts.configs.stylisticTypeChecked,
unicorn.configs['flat/recommended'],
{
name: 'viam/base',
rules: {
'accessor-pairs': ['error'],
'array-callback-return': ['error', { checkForEach: true }],
camelcase: ['error', { properties: 'never', ignoreImports: true }],
'class-methods-use-this': ['error'],
curly: ['error', 'all'],
'default-case-last': ['error'],
'default-param-last': ['error'],
eqeqeq: ['error', 'always', { null: 'always' }],
'func-names': 'error',
'func-style': 'error',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-length': [
'error',
{
exceptions: [
'_',
'x',
'y',
'z',
'w',
'r',
'i',
'j',
'k',
'l',
'h',
'a',
'b',
],
},
],
'line-comment-position': 'error',
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'logical-assignment-operators': 'error',
'max-depth': 'error',
'max-nested-callbacks': 'error',
'max-statements-per-line': 'error',
'new-cap': 'error',
'no-alert': 'error',
'no-await-in-loop': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-console': 'warn',
'no-constant-binary-expression': 'error',
'no-constructor-return': 'error',
'no-debugger': 'warn',
'no-div-regex': 'error',
'no-else-return': 'error',
'no-empty-static-block': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-multi-assign': 'error',
'no-multi-str': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-native-nonconstructor': 'error',
'no-new-object': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'error',
'no-plusplus': 'error',
'no-promise-executor-return': 'error',
'no-proto': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-template-curly-in-string': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable-loop': 'error',
'no-underscore-dangle': ['error', { allow: ['__VERSION__', '_errors'] }],
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-unused-private-class-members': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': ['error', { allowAsStatement: true }],
'object-shorthand': ['error', 'properties'],
'one-var': ['error', 'never'],
'operator-assignment': 'error',
'padding-line-between-statements': 'error',
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-named-capture-group': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
radix: 'error',
'require-unicode-regexp': 'error',
'require-atomic-updates': 'error',
'spaced-comment': ['error', 'always', { markers: ['/'] }],
strict: 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
yoda: 'error',
},
},
rules: {
// Extra built-in rules
'accessor-pairs': ['error'],
'array-callback-return': ['error', { checkForEach: true }],
camelcase: ['error', { properties: 'never', ignoreImports: true }],
'class-methods-use-this': ['error'],
curly: ['error', 'all'],
'default-case-last': ['error'],
'default-param-last': ['error'],
eqeqeq: ['error', 'always', { null: 'always' }],
'func-names': 'error',
'func-style': 'error',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-length': [
'error',
{
exceptions: [
'_',
'x',
'y',
'z',
'w',
'r',
'i',
'j',
'k',
'l',
'h',
'a',
'b',
],
},
],
'line-comment-position': 'error',
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'logical-assignment-operators': 'error',
'max-depth': 'error',
'max-nested-callbacks': 'error',
'max-statements-per-line': 'error',
'new-cap': 'error',
'no-alert': 'error',
'no-await-in-loop': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-console': 'warn',
'no-constant-binary-expression': 'error',
'no-constructor-return': 'error',
'no-debugger': 'warn',
'no-div-regex': 'error',
'no-else-return': 'error',
'no-empty-static-block': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-multi-assign': 'error',
'no-multi-str': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-native-nonconstructor': 'error',
'no-new-object': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'error',
'no-plusplus': 'error',
'no-promise-executor-return': 'error',
'no-proto': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-template-curly-in-string': 'error',
'no-unneeded-ternary': 'error',
'no-unreachable-loop': 'error',
'no-underscore-dangle': ['error', { allow: ['__VERSION__', '_errors'] }],
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-unused-private-class-members': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': ['error', { allowAsStatement: true }],
'object-shorthand': ['error', 'properties'],
'one-var': ['error', 'never'],
'operator-assignment': 'error',
'padding-line-between-statements': 'error',
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-named-capture-group': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
radix: 'error',
'require-unicode-regexp': 'error',
'require-atomic-updates': 'error',
'spaced-comment': ['error', 'always', { markers: ['/'] }],
strict: 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
yoda: 'error',
// Extra TypeScript rules
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true },
],
'@typescript-eslint/no-import-type-side-effects': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-use-before-define': [
'warn',
{
functions: false,
classes: false,
variables: false,
allowNamedExports: true,
ignoreTypeReferences: true,
},
],
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowAny: false,
allowBoolean: true,
allowNever: false,
allowNullish: false,
allowNumber: true,
allowRegExp: false,
},
],
{
name: 'viam/typescript',
rules: {
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: true },
],
'@typescript-eslint/no-import-type-side-effects': ['error'],
'@typescript-eslint/no-misused-spread': ['error', { allow: ['string'] }],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-use-before-define': [
'warn',
{
functions: false,
classes: false,
variables: false,
allowNamedExports: true,
ignoreTypeReferences: true,
},
],
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowAny: false,
allowBoolean: true,
allowNever: false,
allowNullish: false,
allowNumber: true,
allowRegExp: false,
},
],
},
},
// Import sorting
'simple-import-sort/imports': [
'error',
{
groups: [
// Side effect imports
[String.raw`^\u0000`],
// Node.js builtins
['^node:'],
// Third-party packages
['^vitest', '^svelte', '^@sveltejs', String.raw`^@?\w`],
// First-party packages
['^@viamrobotics'],
// Anything not matched in another group, like internal $alias imports
['^'],
// Relative imports
[String.raw`^\.`],
],
},
],
'simple-import-sort/exports': 'error',
{
name: 'viam/unicorn',
rules: {
'unicorn/custom-error-definition': 'error',
'unicorn/no-null': 'off',
'unicorn/no-unused-properties': 'error',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
},
},
// Extra Unicorn rules
'unicorn/custom-error-definition': 'error',
'unicorn/no-null': 'off',
'unicorn/no-unused-properties': 'error',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-string-replace-all': 'error',
'unicorn/prefer-top-level-await': 'off',
'unicorn/prevent-abbreviations': 'off',
// Import sorting
{
name: 'viam/import-sort',
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
// Side effect imports
[String.raw`^\u0000`],
// Node.js builtins
['^node:'],
// Third-party packages
['^vitest', '^svelte', '^@sveltejs', String.raw`^@?\w`],
// First-party packages
['^@viamrobotics'],
// Anything not matched in another group, like internal $alias imports
['^'],
// Relative imports
[String.raw`^\.`],
],
},
],
'simple-import-sort/exports': 'error',
},
},
overrides: [
// CommonJS files are scripts that are allowed to use `require`
{
files: ['**/*.cjs'],
parserOptions: {
sourceType: 'script',
},
env: {
commonjs: true,
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
// Common JS support
{
name: 'viam/commonjs',
files: ['**/*.cjs'],
languageOptions: {
sourceType: 'commonjs',
globals: { ...globals.commonjs },
},
// Rules for tests
{
files: ['**/__tests__/**', '**/*.test.ts', '**/*.spec.ts'],
extends: ['plugin:vitest/legacy-recommended'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'unicorn/consistent-function-scoping': 'off',
'vitest/consistent-test-filename': [
'error',
{
pattern: String.raw`.*\.spec\.(ts|svelte)$`,
},
],
'vitest/consistent-test-it': ['error', { fn: 'it' }],
'vitest/no-conditional-expect': 'error',
'vitest/no-conditional-in-test': 'error',
'vitest/no-conditional-tests': 'error',
'vitest/no-restricted-matchers': [
'error',
{
toBeFalsey: 'Prefer `toBe` or `toEqual`',
toBeTruthy: 'Prefer `toBe` or `toEqual`',
},
],
'vitest/no-restricted-vi-methods': [
'error',
{
spyOn: 'Do not partially mock objects',
},
],
'vitest/prefer-each': 'error',
'vitest/require-top-level-describe': 'error',
'vitest/valid-expect': ['error', { maxArgs: 2 }],
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
// Rules that don't make sense for ambient type files
{
files: '**/*.d.ts',
rules: {
'@typescript-eslint/no-empty-interface': 'off',
},
},
// Tests
{
name: 'viam/vitest',
extends: [vitest.configs.recommended],
files: [
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.spec.ts',
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts',
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'unicorn/consistent-function-scoping': 'off',
'vitest/consistent-test-filename': [
'error',
{ pattern: String.raw`.*\.spec\.(ts|svelte)$` },
],
'vitest/consistent-test-it': ['error', { fn: 'it' }],
'vitest/no-conditional-expect': 'error',
'vitest/no-conditional-in-test': 'error',
'vitest/no-conditional-tests': 'error',
'vitest/no-restricted-matchers': [
'error',
{
toBeFalsey: 'Prefer `toBe` or `toEqual`',
toBeTruthy: 'Prefer `toBe` or `toEqual`',
},
],
'vitest/no-restricted-vi-methods': [
'error',
{ spyOn: 'Do not partially mock objects' },
],
'vitest/prefer-each': 'error',
'vitest/require-top-level-describe': 'error',
'vitest/valid-expect': ['error', { maxArgs: 2 }],
},
],
};
},
{
name: 'viam/ambient-types',
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/no-empty-interface': 'off',
},
},
// Disable rules that are covered by Prettier
prettier
);
export { baseConfig, createConfig };

@@ -7,5 +7,5 @@ {

},
"version": "0.8.0",
"version": "1.0.0",
"description": "ESLint configuration for projects at Viam.",
"type": "commonjs",
"type": "module",
"main": "./eslint-config.js",

@@ -29,10 +29,14 @@ "types": "./dist/eslint-config.d.ts",

"license": "Apache-2.0",
"dependencies": {
"@eslint/js": "~9.20.0",
"@typescript-eslint/utils": "^8.23.0",
"@vitest/eslint-plugin": "~1.1.28",
"eslint-config-prettier": "~10.0.1",
"eslint-plugin-simple-import-sort": "~12.1.1",
"eslint-plugin-unicorn": "~56.0.1",
"globals": "^15.13.0",
"typescript-eslint": "~8.23.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=6 <9",
"@typescript-eslint/parser": ">=6 <9",
"eslint": ">=8 <9",
"eslint-config-prettier": ">=9 <10",
"eslint-plugin-simple-import-sort": ">=12 <13",
"eslint-plugin-unicorn": ">=47 <57",
"eslint-plugin-vitest": ">=0.5 <0.6",
"eslint": ">=9 <10",
"typescript": ">=5 <6",

@@ -42,5 +46,2 @@ "vitest": "*"

"peerDependenciesMeta": {
"eslint-plugin-vitest": {
"optional": true
},
"vitest": {

@@ -47,0 +48,0 @@ "optional": true

# Viam's ESLint Config
This module contains [Viam][]'s shared [ESLint][] configurations for ESLint v8.
This module contains [Viam][]'s shared [ESLint][] configurations for ESLint v9.

@@ -10,28 +10,23 @@ [viam]: https://www.viam.com/

Extend the [config](./eslint-config.js) in `.eslintrc.cjs`.
Extend the [config](./eslint-config.js) in `eslint.config.js`.
> [!TIP]
> See the typescript-eslint docs on [type-aware linting](https://typescript-eslint.io/getting-started/typed-linting) to learn about how to configure `languageOptions`. Using `projectService: true` is recommended for new projects, but older projects may continue to use `project: './tsconfig.json'` for performance or compatibility reasons.
```shell
pnpm add --save-dev \
eslint@^8.56.0 \
@viamrobotics/eslint-config \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin \
eslint-config-prettier \
eslint-plugin-simple-import-sort \
eslint-plugin-unicorn \
eslint-plugin-vitest
pnpm add --save-dev eslint @viamrobotics/eslint-config
```
```js
// .eslintrc.cjs
'use strict';
// eslint.config.js
import { baseConfig, createConfig } from '@viamrobotics/eslint-config';
module.exports = {
root: true,
extends: ['@viamrobotics/eslint-config'],
parserOptions: {
tsconfigRootDir: __dirname,
projectService: true,
export default createConfig(baseConfig, {
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
};
});
```

@@ -38,0 +33,0 @@