| 123456789101112131415161718192021222324252627282930313233343536373839 |
- /* ESLint 8 flat-file predecessor config. This file is .cjs rather than .js
- because package.json sets "type": "module", which would otherwise make
- ESLint try to read this as an ES module. */
- module.exports = {
- root: true,
- env: {
- browser: true,
- es2020: true,
- node: true,
- },
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:react-hooks/recommended',
- ],
- parser: '@typescript-eslint/parser',
- parserOptions: {
- ecmaVersion: 'latest',
- sourceType: 'module',
- ecmaFeatures: { jsx: true },
- },
- plugins: ['@typescript-eslint', 'react-hooks'],
- ignorePatterns: ['dist', 'node_modules', '*.cjs'],
- rules: {
- // TypeScript already reports unused values through noUnusedLocals, and
- // the base rule double-reports on type-only declarations.
- 'no-unused-vars': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'warn',
- { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
- ],
- // The codebase passes API payloads and ReactFlow node data around as
- // any in a lot of places. Worth tightening later, not worth failing
- // the build over today.
- '@typescript-eslint/no-explicit-any': 'off',
- // tsc enforces this far more accurately than the lint rule does.
- '@typescript-eslint/no-empty-function': 'off',
- },
- };
|