diff options
author | Pauline <git@ethanlibs.co> | 2023-10-14 22:27:27 -0400 |
---|---|---|
committer | Pauline <git@ethanlibs.co> | 2023-10-14 22:27:27 -0400 |
commit | 2582162cea2b3a59cd21c78f8b73cb03d0acad40 (patch) | |
tree | 432057475f3b51850a85e2cba9969bcb79f3a8e6 /packages/config/eslint/base.js | |
parent | 06f51ccdc496a6581d098edc424f3973e550221d (diff) | |
download | Nexus-2582162cea2b3a59cd21c78f8b73cb03d0acad40.tar.gz Nexus-2582162cea2b3a59cd21c78f8b73cb03d0acad40.tar.bz2 Nexus-2582162cea2b3a59cd21c78f8b73cb03d0acad40.zip |
refactor(trunk): refactor the entire project idk
Diffstat (limited to 'packages/config/eslint/base.js')
-rw-r--r-- | packages/config/eslint/base.js | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/packages/config/eslint/base.js b/packages/config/eslint/base.js new file mode 100644 index 0000000..200f17d --- /dev/null +++ b/packages/config/eslint/base.js @@ -0,0 +1,79 @@ +const path = require('node:path'); + +/** @type {import('eslint').ESLint.ConfigData} */ +module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaFeatures: { + jsx: true + }, + ecmaVersion: 12, + sourceType: 'module' + }, + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:astro/recommended', + 'plugin:astro/jsx-a11y-recommended', + 'turbo', + 'prettier' + ], + plugins: ['react', 'jsx-a11y'], + rules: { + 'react/display-name': 'off', + 'react/prop-types': 'off', + 'react/no-unescaped-entities': 'off', + 'react/react-in-jsx-scope': 'off', + 'react-hooks/rules-of-hooks': 'warn', + 'react-hooks/exhaustive-deps': 'warn', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-empty-interface': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/ban-types': 'off', + 'no-control-regex': 'off', + 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'], + 'turbo/no-undeclared-env-vars': [ + 'error', + { + cwd: path.resolve(path.join(__dirname, '..', '..', '..')) + } + ] + }, + ignorePatterns: ['dist', '**/*.js', '**/*.json', 'node_modules'], + settings: { + react: { + version: 'detect' + } + }, + overrides: [ + { + files: ['*.astro'], + parser: 'astro-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + extraFileExtensions: ['.astro'] + }, + rules: { + 'astro/no-set-html-directive': 2, + 'indent': 'off' + } + }, + { + files: ['*.ts', '*.d.ts', '*.tsx', '*.js', '*.jsx', '*.mjs', '*.cjs'], + parser: '@typescript-eslint/parser', + parserOptions: { + parser: '@typescript-eslint/parser' + }, + rules: { + indent: 'off' + } + } + ] +}; |