diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-04-03 17:40:59 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-04-03 17:40:59 +0200 |
commit | 4d5b4dacd655159189287e2bdf4501bdcab36981 (patch) | |
tree | 878cbf16609605672bc91c256f823f9cb6df1bf8 /.eslintrc.js | |
parent | 8192b0da7cd1fac38a68eab6746fc7ec74328a77 (diff) | |
parent | 77bd32a26abbf8b49caf35dcdf170e312e48a277 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index faed3c54a..bbdfa7de2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,20 +13,20 @@ module.exports = { browser: true, node: true, es6: true, - jest: true, }, globals: { ATTACHMENT_HOST: false, }, - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', plugins: [ 'react', 'jsx-a11y', 'import', 'promise', + '@typescript-eslint', ], parserOptions: { @@ -46,9 +46,6 @@ module.exports = { react: { version: 'detect', }, - 'import/extensions': [ - '.js', '.jsx', - ], 'import/ignore': [ 'node_modules', '\\.(css|scss|json)$', @@ -56,7 +53,7 @@ module.exports = { 'import/resolver': { node: { paths: ['app/javascript'], - extensions: ['.js', '.jsx'], + extensions: ['.js', '.jsx', '.ts', '.tsx'], }, }, }, @@ -97,7 +94,8 @@ module.exports = { 'no-self-assign': 'off', 'no-trailing-spaces': 'warn', 'no-unused-expressions': 'error', - 'no-unused-vars': [ + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ 'error', { vars: 'all', @@ -116,7 +114,7 @@ module.exports = { semi: 'error', 'valid-typeof': 'error', - 'react/jsx-filename-extension': ['error', { 'allow': 'as-needed' }], + 'react/jsx-filename-extension': ['error', { extensions: ['.jsx', 'tsx'] }], 'react/jsx-boolean-value': 'error', 'react/jsx-closing-bracket-location': ['error', 'line-aligned'], 'react/jsx-curly-spacing': 'error', @@ -192,6 +190,8 @@ module.exports = { { js: 'never', jsx: 'never', + ts: 'never', + tsx: 'never', }, ], 'import/newline-after-import': 'error', @@ -200,6 +200,7 @@ module.exports = { { devDependencies: [ 'config/webpack/**', + 'app/javascript/mastodon/performance.js', 'app/javascript/mastodon/test_setup.js', 'app/javascript/**/__tests__/**', ], @@ -235,5 +236,35 @@ module.exports = { sourceType: 'script', }, }, + { + files: [ + '**/*.ts', + '**/*.tsx', + ], + + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react/recommended', + 'plugin:jsx-a11y/recommended', + 'plugin:import/recommended', + 'plugin:import/typescript', + 'plugin:promise/recommended', + ], + + rules: { + '@typescript-eslint/no-explicit-any': 'off', + }, + }, + { + files: [ + '**/__tests__/*.js', + '**/__tests__/*.jsx', + ], + + env: { + jest: true, + }, + }, ], }; |