Skip to content

Commit

Permalink
merging eslint files
Browse files Browse the repository at this point in the history
  • Loading branch information
rsun19 committed Jul 24, 2024
1 parent aa6f701 commit 4a7ff20
Show file tree
Hide file tree
Showing 14 changed files with 4,366 additions and 4,402 deletions.
224 changes: 224 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true
},
// includes the typescript specific rules found here: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
"plugins": [
"@typescript-eslint",
"import",
"no-only-tests",
"no-relative-import-paths",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"ignorePatterns": [
"package.json",
"./frontend/src/third_party/mlmd",
"./frontend/src/__tests__/cypress/.nyc_output",
"./frontend/src/__tests__/cypress/coverage",
"./frontend/package.json",
"./frontend/config"
],
"globals": {
"window": "readonly",
"describe": "readonly",
"test": "readonly",
"expect": "readonly",
"it": "readonly",
"process": "readonly",
"document": "readonly"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"project": "."
}
}
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-explicit-any": "off",
"import/extensions": "off",
"@typescript-eslint/explicit-module-boundary-types": "error",
"import/no-unresolved": "off",
"prettier/prettier": [
"error",
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100
}
]
// "jsx-a11y/no-autofocus": ["error", { "ignoreNonDOM": true }],
// "jsx-a11y/anchor-is-valid": [
// "error",
// {
// "components": ["Link"],
// "specialLink": ["to"],
// "aspects": ["noHref", "invalidHref", "preferButton"]
// }
// ],
// "arrow-body-style": "error",
// "curly": "error",
// "no-only-tests/no-only-tests": "error",
// "@typescript-eslint/default-param-last": "error",
// "@typescript-eslint/dot-notation": ["error", { "allowKeywords": true }],
// "@typescript-eslint/lines-between-class-members": [
// "error",
// "always",
// { "exceptAfterSingleLine": false }
// ],
// "@typescript-eslint/method-signature-style": "error",
// "@typescript-eslint/naming-convention": [
// "error",
// {
// "selector": "variable",
// "format": ["camelCase", "PascalCase", "UPPER_CASE"]
// },
// {
// "selector": "function",
// "format": ["camelCase", "PascalCase"]
// },
// {
// "selector": "typeLike",
// "format": ["PascalCase"]
// }
// ],
// "@typescript-eslint/no-unused-expressions": [
// "error",
// {
// "allowShortCircuit": false,
// "allowTernary": false,
// "allowTaggedTemplates": false
// }
// ],
// "@typescript-eslint/no-redeclare": "error",
// "@typescript-eslint/no-shadow": "error",
// "@typescript-eslint/return-await": ["error", "in-try-catch"],
// "camelcase": "warn",
// "no-else-return": ["error", { "allowElseIf": false }],
// "eqeqeq": ["error", "always", { "null": "ignore" }],
// "object-shorthand": ["error", "always"],
// "no-console": "error",
// "no-param-reassign": [
// "error",
// {
// "props": true,
// "ignorePropertyModificationsFor": ["acc", "e"],
// "ignorePropertyModificationsForRegex": ["^assignable[A-Z]"]
// }
// ],
// "@typescript-eslint/no-base-to-string": "error",
// "@typescript-eslint/no-unused-vars": "error",
// "@typescript-eslint/no-unnecessary-condition": "error",
// "prefer-destructuring": [
// "error",
// {
// "VariableDeclarator": {
// "array": false,
// "object": true
// },
// "AssignmentExpression": {
// "array": true,
// "object": false
// }
// },
// {
// "enforceForRenamedProperties": false
// }
// ],
// "import/order": [
// "error",
// {
// "pathGroups": [
// {
// "pattern": "~/**",
// "group": "external",
// "position": "after"
// }
// ],
// "pathGroupsExcludedImportTypes": ["builtin"],
// "groups": [
// "builtin",
// "external",
// "internal",
// "index",
// "sibling",
// "parent",
// "object",
// "unknown"
// ]
// }
// ],
// "no-restricted-properties": [
// "error",
// {
// "object": "Promise",
// "property": "allSettled",
// "message": "Avoid using Promise.allSettled, use allSettledPromises utility function instead."
// },
// {
// "property": "sort",
// "message": "Avoid using .sort, use .toSorted instead."
// }
// ],
// "import/newline-after-import": "error",
// "import/no-duplicates": "error",
// "import/no-named-as-default": "error",
// "import/no-extraneous-dependencies": [
// "error",
// {
// "devDependencies": true,
// "optionalDependencies": true
// }
// ],
// "no-relative-import-paths/no-relative-import-paths": [
// "warn",
// {
// "allowSameFolder": true,
// "rootDir": "src",
// "prefix": "~"
// }
// ],
// "array-callback-return": ["error", { "allowImplicit": true }],
// "prefer-template": "error",
// "no-lone-blocks": "error",
// "no-lonely-if": "error",
// "no-promise-executor-return": "error",
// "no-restricted-globals": [
// "error",
// {
// "name": "isFinite",
// "message": "Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite"
// },
// {
// "name": "isNaN",
// "message": "Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan"
// }
// ],
// "no-sequences": "error",
// "no-undef-init": "error",
// "no-unneeded-ternary": ["error", { "defaultAssignment": false }],
// "no-useless-computed-key": "error",
// "no-useless-return": "error",
// "symbol-description": "error",
// "yoda": "error",
// "func-names": "warn"
}
}
2 changes: 1 addition & 1 deletion backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package.json
jest.config.js
jest.config.js
45 changes: 2 additions & 43 deletions backend/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"node": true
},
"extends": "../.eslintrc",
// tell the TypeScript parser that we want to use JSX syntax
"parserOptions": {
"tsx": true,
Expand All @@ -13,50 +9,13 @@
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
// includes the typescript specific rules found here: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"globals": {
"window": "readonly",
"describe": "readonly",
"test": "readonly",
"expect": "readonly",
"it": "readonly",
"process": "readonly",
"document": "readonly"
},
"settings": {},
"rules": {
"eqeqeq": ["error", "always", { "null": "ignore" }],
"no-restricted-properties": [
"error",
{
"property": "toString",
"message": "e.toString() should be fastify.log.error(e, 'your string'). Other use-cases should avoid obj.toString() on principle. Craft the string you want instead."
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-explicit-any": "off",
"import/extensions": "off",
"@typescript-eslint/explicit-module-boundary-types": "error",
"import/no-unresolved": "off",
"prettier/prettier": [
"error",
{
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100
}
]
}
}
}
Loading

0 comments on commit 4a7ff20

Please sign in to comment.