taye/interact.js

View on GitHub
.eslintrc.cjs

Summary

Maintainability
Test Coverage
module.exports = {
  extends: [
    'plugin:import/errors',
    'plugin:import/warnings',
    'plugin:import/typescript',
    'plugin:react/all',
    'standard',
    'prettier',
  ],
  settings: {
    'import/resolver': { typescript: null },
    react: { version: '16' },
  },
  env: {
    commonjs: true,
    es6: true,
    node: true,
  },
  parser: '@typescript-eslint/parser',
  parserOptions: {
    sourceType: 'module',
    ecmaVersion: 2020,
  },
  plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'markdown'],
  globals: {
    globalThis: false,
  },
  rules: {
    'linebreak-style': ['error', 'unix'],
    'lines-between-class-members': 'off',
    'no-caller': 'error',
    'no-console': 'off',
    'no-empty': 'off',
    'no-prototype-builtins': 'off',
    'no-shadow': 'error',
    'no-useless-constructor': 'off',
    'no-var': 'error',
    'import/no-extraneous-dependencies': ['error', { devDependencies: false }],
    'import/order': [
      'error',
      {
        alphabetize: { order: 'asc', caseInsensitive: true },
        'newlines-between': 'always',
        groups: ['builtin', 'external', 'internal', 'parent', 'index', 'sibling'],
        pathGroups: [{ pattern: '@interactjs/**', group: 'internal' }],
      },
    ],
    'operator-linebreak': 'off',
    'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
    'prefer-const': 'error',
    'standard/array-bracket-even-spacing': 'off',
    'standard/computed-property-even-spacing': 'off',
    'standard/object-curly-even-spacing': 'off',
    'tsdoc/syntax': 'warn',
    '@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
    '@typescript-eslint/consistent-type-imports': 'error',
    '@typescript-eslint/explicit-member-accessibility': 'off',
    '@typescript-eslint/member-accessibility': 'off',
    '@typescript-eslint/no-empty-interface': 'error',
    '@typescript-eslint/no-inferrable-types': 'error',
    '@typescript-eslint/no-use-before-define': 'off',
  },
  overrides: [
    {
      files: '*.{ts{,x},vue}',
      rules: {
        'import/named': 'off',
        'import/no-named-as-default': 'off',
        'import/no-unresolved': 'off',
        'no-redeclare': 'off',
        'no-shadow': 'off',
        'no-undef': 'off',
        'no-unused-vars': 'off',
        'no-use-before-define': 'off',
      },
    },
    {
      files: '{,.md/}*.vue',
      extends: ['plugin:vue/vue3-essential'],
      parserOptions: { parser: '@typescript-eslint/parser' },
    },
    {
      files: '*.spec.ts',
      extends: ['plugin:jest/recommended', 'plugin:jest/style'],
      rules: {
        'array-bracket-spacing': 'off',
        'import/no-extraneous-dependencies': 'off',
        'jest/consistent-test-it': ['error', { fn: 'test' }],
      },
    },
    { files: '**/*.md', processor: 'markdown/markdown' },
    {
      files: '**/*.md/*.{{ts,js}{,x},vue}',
      rules: {
        'arrow-parens': 'off',
        'import/no-named-as-default': 'off',
        'import/no-unresolved': 'off',
        'no-console': 'off',
        'no-redeclare': 'off',
        'no-shadow': 'off',
        'no-undef': 'off',
        'no-unused-vars': 'off',
        'no-use-before-define': 'off',
        'no-var': 'off',
        'prefer-arrow-callback': 'off',
      },
    },
  ],
}