| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- import typescriptEslint from '@typescript-eslint/eslint-plugin';
- import globals from 'globals';
- import tsParser from '@typescript-eslint/parser';
- import path from 'node:path';
- import {fileURLToPath} from 'node:url';
- import js from '@eslint/js';
- import {FlatCompat} from '@eslint/eslintrc';
- const __filename = fileURLToPath(import.meta.url);
- const __dirname = path.dirname(__filename);
- const compat = new FlatCompat({
- baseDirectory: __dirname,
- recommendedConfig: js.configs.recommended,
- allConfig: js.configs.all
- });
- export default [{
- ignores: [
- 'src/vendor/**/*',
- 'src/solid/**/*',
- 'src/opus-recorder/**/*',
- 'public/**/*'
- ]
- }, ...compat.extends(), {
- plugins: {
- '@typescript-eslint': typescriptEslint
- },
- languageOptions: {
- globals: {
- ...globals.browser
- },
- parser: tsParser,
- ecmaVersion: 'latest',
- sourceType: 'module',
- parserOptions: {
- project: ['./tsconfig.json']
- }
- },
- rules: {
- 'max-len': 'off',
- 'keyword-spacing': ['error', {
- after: true,
- overrides: {
- if: {
- before: true,
- after: false
- },
- else: {
- before: true
- },
- catch: {
- before: true,
- after: false
- },
- for: {
- after: false
- },
- while: {
- after: false
- },
- switch: {
- after: false
- }
- }
- }],
- 'linebreak-style': ['error', 'unix'],
- 'eol-last': 'error',
- 'indent': ['error', 2, {
- CallExpression: {
- arguments: 1
- },
- FunctionDeclaration: {
- body: 1,
- parameters: 1
- },
- FunctionExpression: {
- body: 1,
- parameters: 1
- },
- MemberExpression: 0,
- ObjectExpression: 1,
- SwitchCase: 1,
- ignoredNodes: ['ConditionalExpression']
- }],
- 'space-before-function-paren': ['error', 'never'],
- 'prefer-promise-reject-errors': 'off',
- 'curly': 'off',
- 'comma-dangle': ['error', 'never'],
- 'comma-spacing': 'error',
- 'comma-style': 'error',
- 'quote-props': ['error', 'consistent'],
- 'quotes': ['error', 'single', {
- allowTemplateLiterals: true
- }],
- 'space-before-blocks': ['error', 'always'],
- 'spaced-comment': ['error', 'always'],
- 'prefer-spread': 'off',
- 'prefer-const': ['error', {
- destructuring: 'all'
- }],
- 'object-curly-spacing': ['error', 'never'],
- 'array-bracket-spacing': ['error', 'never'],
- 'switch-colon-spacing': 'error',
- 'operator-linebreak': ['error', 'after'],
- 'padded-blocks': ['error', 'never'],
- 'no-useless-call': 'error',
- 'no-trailing-spaces': 'error',
- 'no-mixed-spaces-and-tabs': 'error',
- 'no-multiple-empty-lines': ['error', {
- max: 2
- }],
- 'no-tabs': 'error',
- 'no-multi-str': 'error',
- 'no-new-wrappers': 'error',
- 'no-irregular-whitespace': ['error', {
- skipStrings: true,
- skipComments: true,
- skipRegExps: true,
- skipTemplates: true
- }],
- 'no-unexpected-multiline': 'error',
- 'no-return-await': 'error',
- '@typescript-eslint/await-thenable': 'error'
- }
- }, {
- files: ['**/*.ts', '**/*.tsx'],
- languageOptions: {
- ecmaVersion: 5,
- sourceType: 'script',
- parserOptions: {
- project: ['./tsconfig.json']
- }
- }
- }, {
- files: ['**/*.js'],
- languageOptions: {
- ecmaVersion: 'latest',
- sourceType: 'script'
- },
- rules: {
- '@typescript-eslint/await-thenable': 'off'
- }
- }];
|