parent
84a4ad84d8
commit
fa1ec6c7ec
@ -0,0 +1,90 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": ["typescript", "react"],
|
||||
"categories": {
|
||||
"correctness": "error"
|
||||
},
|
||||
"settings": {
|
||||
"next": {
|
||||
"rootDir": ["apps/portal/"]
|
||||
}
|
||||
},
|
||||
"ignorePatterns": [
|
||||
".next/**",
|
||||
".turbo/**",
|
||||
".cache/**",
|
||||
"dist/**",
|
||||
"dist-ssr/**",
|
||||
"coverage/**",
|
||||
"public/dist/**",
|
||||
"server/dist/**",
|
||||
"apps/portal/build/**",
|
||||
"apps/portal/out/**",
|
||||
"apps/portal/prisma/**",
|
||||
"apps/website/.docusaurus/**",
|
||||
"apps/website/.cache-loader/**",
|
||||
"apps/website/experimental/**"
|
||||
],
|
||||
"rules": {
|
||||
"camelcase": ["error", { "properties": "never", "ignoreDestructuring": true }],
|
||||
"capitalized-comments": [
|
||||
"error",
|
||||
"always",
|
||||
{ "ignoreConsecutiveComments": true }
|
||||
],
|
||||
"curly": "error",
|
||||
"eqeqeq": ["error", "smart"],
|
||||
"func-names": ["error", "as-needed"],
|
||||
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||
"guard-for-in": "error",
|
||||
"init-declarations": "error",
|
||||
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
|
||||
"no-else-return": ["error", { "allowElseIf": false }],
|
||||
"no-lonely-if": "error",
|
||||
"no-shadow": "off",
|
||||
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
||||
"operator-assignment": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-destructuring": ["error", { "object": true }],
|
||||
"radix": "error",
|
||||
"react/button-has-type": "error",
|
||||
"react/display-name": "off",
|
||||
"react/exhaustive-deps": "off",
|
||||
"react/jsx-boolean-value": ["error", "always"],
|
||||
"react/jsx-curly-brace-presence": [
|
||||
"error",
|
||||
{ "props": "never", "children": "never" }
|
||||
],
|
||||
"react/jsx-no-useless-fragment": "error",
|
||||
"react/no-array-index-key": "error",
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/void-dom-elements-no-children": "error",
|
||||
"typescript/array-type": [
|
||||
"error",
|
||||
{ "default": "generic", "readonly": "generic" }
|
||||
],
|
||||
"typescript/ban-ts-comment": "off",
|
||||
"typescript/consistent-generic-constructors": ["error", "constructor"],
|
||||
"typescript/consistent-indexed-object-style": ["error", "record"],
|
||||
"typescript/consistent-type-definitions": ["error", "type"],
|
||||
"typescript/consistent-type-imports": "error",
|
||||
"typescript/dot-notation": "error",
|
||||
"typescript/no-duplicate-enum-values": "error",
|
||||
"typescript/no-explicit-any": "off",
|
||||
"typescript/no-for-in-array": "error",
|
||||
"typescript/prefer-optional-chain": "error",
|
||||
"typescript/require-array-sort-compare": "error",
|
||||
"typescript/restrict-plus-operands": "error"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["apps/portal/**/*.{js,jsx,ts,tsx}"],
|
||||
"plugins": ["typescript", "react", "nextjs"],
|
||||
"rules": {
|
||||
"nextjs/no-html-link-for-pages": "off",
|
||||
"nextjs/no-img-element": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["oxc.oxc-vscode"]
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['tih'],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/ban-ts-comment': 0,
|
||||
},
|
||||
};
|
||||
@ -1,148 +0,0 @@
|
||||
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
||||
|
||||
const OFF = 0;
|
||||
const WARN = 1;
|
||||
const ERROR = 2;
|
||||
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
'simple-import-sort',
|
||||
'sort-keys-fix',
|
||||
'typescript-sort-keys',
|
||||
],
|
||||
extends: [
|
||||
'next/core-web-vitals',
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
camelcase: [ERROR, { properties: 'never', ignoreDestructuring: true }],
|
||||
'capitalized-comments': [
|
||||
ERROR,
|
||||
'always',
|
||||
{ ignoreConsecutiveComments: true },
|
||||
],
|
||||
'consistent-this': ERROR,
|
||||
curly: ERROR,
|
||||
'dot-notation': ERROR,
|
||||
eqeqeq: [ERROR, 'smart'],
|
||||
'func-name-matching': ERROR,
|
||||
'func-names': [ERROR, 'as-needed'],
|
||||
'func-style': [ERROR, 'declaration', { allowArrowFunctions: true }],
|
||||
'guard-for-in': ERROR,
|
||||
'init-declarations': ERROR,
|
||||
'no-console': [ERROR, { allow: ['warn', 'error', 'info'] }],
|
||||
'no-else-return': [ERROR, { allowElseIf: false }],
|
||||
'no-extra-boolean-cast': ERROR,
|
||||
'no-lonely-if': ERROR,
|
||||
'no-shadow': OFF,
|
||||
'no-unused-vars': OFF, // Use @typescript-eslint/no-unused-vars instead.
|
||||
'object-shorthand': ERROR,
|
||||
'one-var': [ERROR, 'never'],
|
||||
'operator-assignment': ERROR,
|
||||
'prefer-arrow-callback': ERROR,
|
||||
'prefer-const': ERROR,
|
||||
'prefer-destructuring': [
|
||||
ERROR,
|
||||
{
|
||||
object: true,
|
||||
},
|
||||
],
|
||||
radix: ERROR,
|
||||
'spaced-comment': ERROR,
|
||||
|
||||
'react/button-has-type': ERROR,
|
||||
'react/display-name': OFF,
|
||||
'react/destructuring-assignment': [ERROR, 'always'],
|
||||
// 'react/hook-use-state': ERROR,
|
||||
'react/no-array-index-key': ERROR,
|
||||
'react/no-unescaped-entities': OFF,
|
||||
'react/void-dom-elements-no-children': ERROR,
|
||||
|
||||
'react/jsx-boolean-value': [ERROR, 'always'],
|
||||
'react/jsx-curly-brace-presence': [
|
||||
ERROR,
|
||||
{ props: 'never', children: 'never' },
|
||||
],
|
||||
'react/jsx-no-useless-fragment': ERROR,
|
||||
'react/jsx-sort-props': [
|
||||
ERROR,
|
||||
{
|
||||
callbacksLast: true,
|
||||
shorthandFirst: true,
|
||||
reservedFirst: true,
|
||||
},
|
||||
],
|
||||
|
||||
'@next/next/no-img-element': OFF,
|
||||
'@next/next/no-html-link-for-pages': OFF,
|
||||
|
||||
'@typescript-eslint/array-type': [
|
||||
ERROR,
|
||||
{ default: 'generic', readonly: 'generic' },
|
||||
],
|
||||
'@typescript-eslint/consistent-generic-constructors': [
|
||||
ERROR,
|
||||
'constructor',
|
||||
],
|
||||
'@typescript-eslint/consistent-indexed-object-style': [ERROR, 'record'],
|
||||
'@typescript-eslint/consistent-type-definitions': [ERROR, 'type'],
|
||||
'@typescript-eslint/consistent-type-imports': ERROR,
|
||||
'@typescript-eslint/no-duplicate-enum-values': ERROR,
|
||||
'@typescript-eslint/no-for-in-array': ERROR,
|
||||
'@typescript-eslint/no-non-null-assertion': OFF,
|
||||
'@typescript-eslint/no-unused-vars': [ERROR, { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-shadow': ERROR,
|
||||
'@typescript-eslint/prefer-optional-chain': ERROR,
|
||||
'@typescript-eslint/require-array-sort-compare': ERROR,
|
||||
'@typescript-eslint/restrict-plus-operands': ERROR,
|
||||
'@typescript-eslint/sort-type-union-intersection-members': ERROR,
|
||||
|
||||
// Sorting
|
||||
'typescript-sort-keys/interface': ERROR,
|
||||
'typescript-sort-keys/string-enum': ERROR,
|
||||
'sort-keys-fix/sort-keys-fix': ERROR,
|
||||
'simple-import-sort/exports': WARN,
|
||||
'simple-import-sort/imports': [
|
||||
WARN,
|
||||
{
|
||||
groups: [
|
||||
// Ext library & side effect imports.
|
||||
['^~?\\w', '^\\u0000', '^@'],
|
||||
// Lib and hooks.
|
||||
['^~/lib', '^~/hooks'],
|
||||
// Static data.
|
||||
['^~/data'],
|
||||
// Components.
|
||||
['^~/components'],
|
||||
// Other imports.
|
||||
['^~/'],
|
||||
// Relative paths up until 3 level.
|
||||
[
|
||||
'^\\./?$',
|
||||
'^\\.(?!/?$)',
|
||||
'^\\.\\./?$',
|
||||
'^\\.\\.(?!/?$)',
|
||||
'^\\.\\./\\.\\./?$',
|
||||
'^\\.\\./\\.\\.(?!/?$)',
|
||||
'^\\.\\./\\.\\./\\.\\./?$',
|
||||
'^\\.\\./\\.\\./\\.\\.(?!/?$)',
|
||||
],
|
||||
['^~/types'],
|
||||
// {s}css files
|
||||
['^.+\\.s?css$'],
|
||||
// Others that don't fit in.
|
||||
['^'],
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@ -1,21 +0,0 @@
|
||||
{
|
||||
"name": "eslint-config-tih",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"eslint-config-next": "^12.3.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-config-turbo": "latest",
|
||||
"eslint-plugin-react": "7.28.0",
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
||||
"eslint-plugin-typescript-sort-keys": "^2.1.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue