<commit_before>/** @type { import('eslint').Linter.Config } */
module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: [
      './tsconfig.eslint.json',
      './packages/*/tsconfig.json',
      './plugins/*/tsconfig.json',
    ],
    tsconfigRootDir: __dirname,
    ecmaFeatures: {
      jsx: true,
    },
  },
  extends: [
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended',
  ],
  plugins: [
    '@typescript-eslint',
    'react',
    'jest',
    'html',
    'json',
    'filenames',
    'react-hooks',
    'import',
    'simple-import-sort',
  ],
  globals: {
    __DEV__: true,
    fail: true,
    NodeJS: true,
    HTMLDivElement: true,
    HTMLElement: true,
    HTMLInputElement: true,
    HTMLSelectElement: true,
    JSX: true,
  },
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    'jest/globals': true,
    node: true,
  },
  overrides: [
    {
      files: ['*.js'],
      rules: {
        '@typescript-eslint/no-var-requires': 'off',
      },
    },
  ],
  rules: {
    'array-bracket-spacing': 'error',
    'brace-style': 'off', // successor('@typescript-eslint/brace-style')
    'camelcase': ['error', { allow: ['__export_format', '__export_date', '__export_source'] }],
    'comma-dangle': ['error', 'always-multiline'],
    'comma-spacing': 'error',
    'default-case': 'error',
    'default-case-last': 'error',
    'filenames/match-exported': ['error', 'kebab'],
    'indent': ['error', 2, { SwitchCase: 1 }],
    'eol-last': ['error', 'always'],
    'arrow-parens': ['error', 'as-needed'],
    'keyword-spacing': 'off', // successor('@typescript-eslint/keyword-spacing')
    'no-async-promise-executor': 'off',
    'no-case-declarations': 'off',
    'no-duplicate-imports': 'off',
    'no-prototype-builtins': 'off',
    'no-redeclare': 'off',
    'no-unused-vars': 'off',
    'no-use-before-define': 'off',
    'no-var': 'error',
    'no-trailing-spaces': 'error',
    'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0 }],
    'object-curly-spacing': ['error', 'always'],
    'quotes': 'off',
    'semi': ['error', 'always'],
    'space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
    'space-in-parens': 'error',
    'spaced-comment': ['error', 'always', {
      exceptions: ['/', '*', '-', '* '], // for ASCII art :)
      markers: [
        '/', // for TypeScript directives, doxygen, vsdoc, etc. (which use `///`)
        '?', // for Quokka
      ],
    }],

    'filenames/match-exported': ['error', 'kebab'],

    'react/no-find-dom-node': 'off',
    'react/no-unescaped-entities': 'off', // TSCONVERSION
    'react/jsx-first-prop-new-line': ['error', 'multiline'],
    'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/prop-types': 'off',
    'react/function-component-definition': ['error', {
      'namedComponents':  'arrow-function',
      'unnamedComponents': 'arrow-function',
    }],
    'react/jsx-max-props-per-line': ['error', { 'maximum': 1, 'when': 'multiline' }],
    'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
    'react/prefer-stateless-function': 'warn', // TODO: fix this and change to error
    'react/jsx-key': ['error', { 'checkFragmentShorthand': true }],
    'react/no-array-index-key': 'warn',
    'react/self-closing-comp': 'error',

    'react-hooks/exhaustive-deps': ['error', {
      // From react-use https://github.com/streamich/react-use/issues/1703#issuecomment-770972824
      'additionalHooks': '^use(Async|AsyncFn|AsyncRetry|Debounce|UpdateEffect|IsomorphicLayoutEffect|DeepCompareEffect|ShallowCompareEffect)$',
    }],
    'react-hooks/rules-of-hooks': 'error',

    '@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
    '@typescript-eslint/ban-types': 'off',
    '@typescript-eslint/brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
    '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/keyword-spacing': 'error',
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
    '@typescript-eslint/no-redeclare': 'error',
    '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
    '@typescript-eslint/no-use-before-define': 'error',
    '@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true }],

    'simple-import-sort/imports': 'error',
  },
};<commit_msg>adds operator spacing rules (#3905)<commit_after>/** @type { import('eslint').Linter.Config } */
module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: [
      './tsconfig.eslint.json',
      './packages/*/tsconfig.json',
      './plugins/*/tsconfig.json',
    ],
    tsconfigRootDir: __dirname,
    ecmaFeatures: {
      jsx: true,
    },
  },
  extends: [
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended',
  ],
  plugins: [
    '@typescript-eslint',
    'react',
    'jest',
    'html',
    'json',
    'filenames',
    'react-hooks',
    'import',
    'simple-import-sort',
  ],
  globals: {
    __DEV__: true,
    fail: true,
    NodeJS: true,
    HTMLDivElement: true,
    HTMLElement: true,
    HTMLInputElement: true,
    HTMLSelectElement: true,
    JSX: true,
  },
  env: {
    browser: true,
    commonjs: true,
    es6: true,
    'jest/globals': true,
    node: true,
  },
  overrides: [
    {
      files: ['*.js'],
      rules: {
        '@typescript-eslint/no-var-requires': 'off',
      },
    },
  ],
  rules: {
    'array-bracket-spacing': 'error',
    'brace-style': 'off', // successor('@typescript-eslint/brace-style')
    'camelcase': ['error', { allow: ['__export_format', '__export_date', '__export_source'] }],
    'comma-dangle': ['error', 'always-multiline'],
    'comma-spacing': 'error',
    'default-case': 'error',
    'default-case-last': 'error',
    'filenames/match-exported': ['error', 'kebab'],
    'indent': ['error', 2, { SwitchCase: 1 }],
    'eol-last': ['error', 'always'],
    'arrow-parens': ['error', 'as-needed'],
    'keyword-spacing': 'off', // successor('@typescript-eslint/keyword-spacing')
    'no-async-promise-executor': 'off',
    'no-case-declarations': 'off',
    'no-duplicate-imports': 'off',
    'no-prototype-builtins': 'off',
    'no-redeclare': 'off',
    'no-unused-vars': 'off',
    'no-use-before-define': 'off',
    'no-var': 'error',
    'no-trailing-spaces': 'error',
    'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0 }],
    'object-curly-spacing': ['error', 'always'],
    'quotes': 'off',
    'semi': ['error', 'always'],
    'space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
    'space-infix-ops': 'off', // successor('@typescript-eslint/space-infix-ops')
    'space-unary-ops': 'error',
    'space-in-parens': 'error',
    'spaced-comment': ['error', 'always', {
      exceptions: ['/', '*', '-', '* '], // for ASCII art :)
      markers: [
        '/', // for TypeScript directives, doxygen, vsdoc, etc. (which use `///`)
        '?', // for Quokka
      ],
    }],

    'filenames/match-exported': ['error', 'kebab'],

    'react/no-find-dom-node': 'off',
    'react/no-unescaped-entities': 'off', // TSCONVERSION
    'react/jsx-first-prop-new-line': ['error', 'multiline'],
    'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
    'react/jsx-uses-react': 'error',
    'react/jsx-uses-vars': 'error',
    'react/jsx-indent': ['error', 2],
    'react/jsx-indent-props': ['error', 2],
    'react/prop-types': 'off',
    'react/function-component-definition': ['error', {
      'namedComponents':  'arrow-function',
      'unnamedComponents': 'arrow-function',
    }],
    'react/jsx-max-props-per-line': ['error', { 'maximum': 1, 'when': 'multiline' }],
    'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
    'react/prefer-stateless-function': 'warn', // TODO: fix this and change to error
    'react/jsx-key': ['error', { 'checkFragmentShorthand': true }],
    'react/no-array-index-key': 'warn',
    'react/self-closing-comp': 'error',

    'react-hooks/exhaustive-deps': ['error', {
      // From react-use https://github.com/streamich/react-use/issues/1703#issuecomment-770972824
      'additionalHooks': '^use(Async|AsyncFn|AsyncRetry|Debounce|UpdateEffect|IsomorphicLayoutEffect|DeepCompareEffect|ShallowCompareEffect)$',
    }],
    'react-hooks/rules-of-hooks': 'error',

    '@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
    '@typescript-eslint/ban-types': 'off',
    '@typescript-eslint/brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
    '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/keyword-spacing': 'error',
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
    '@typescript-eslint/no-redeclare': 'error',
    '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
    '@typescript-eslint/no-use-before-define': 'error',
    '@typescript-eslint/space-infix-ops': 'error',
    '@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true }],

    'simple-import-sort/imports': 'error',
  },
};
{'fraction_non_alphanumeric': 0.21761605513886073, 'fraction_numerical': 0.005067909993918508, 'mean_word_length': 3.363998230871296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1716377', 'n_tokens_mistral': 3582, 'n_tokens_neox': 3524, 'n_words': 559}