Skip to content

Commit

Permalink
[service] update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
restjohn committed Oct 11, 2023
1 parent ff42ebb commit f66b822
Show file tree
Hide file tree
Showing 4 changed files with 1,598 additions and 1,550 deletions.
98 changes: 41 additions & 57 deletions service/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,45 @@
// {
// "parser": "@typescript-eslint/parser",
// "parserOptions": {
// "ecmaVersion": 6,
// "sourceType": "module"
// },
// "rules": {
// "indent": [2, 2],
// "linebreak-style": [2, "unix"],
// "semi": [2, "always"],
// "complexity": [2, 10],
// "no-console": [0],
// "camelcase": [1],
// "eqeqeq": [1]
// },
// "env": {
// "node": true,
// "es6": true
// },
// "extends": [
// "eslint:recommended"
// ]
// }

module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
"ignorePatterns": [ "test/", "node_modules" ],
rules: {
"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never" }],
// disable the rule for all files
"@typescript-eslint/explicit-function-return-type": "off",
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: [ '@typescript-eslint' ],
parserOptions: {
ecmaVersion: 2023, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
ignorePatterns: [ 'test/', 'lib/', 'test-lib/', 'node_modules/', '.eslintrc.js' ],
rules: {
"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never" }],
// disable the rule for all files
"@typescript-eslint/explicit-function-return-type": "off",
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-function-return-type": [ "error" ],
"@typescript-eslint/no-explicit-any": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error",
{ ignoreTypeReferences: true, enums: false, typedefs: false, classes: false, functions: false },
]
}
},
"overrides": [
{
// enable the rule specifically for TypeScript files
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": [ "error", { "functions": false }]
}
},
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-use-before-define": ["error", { "functions": false }]
}
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-use-before-define": ["error", { "functions": false }]
}
]
};
}
]
};
Loading

0 comments on commit f66b822

Please sign in to comment.