From a4107c6b06e46a8ea31194890dea5a262b01fb9f Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 12 Feb 2024 13:59:52 -0800 Subject: [PATCH] chore(api-rest): enable eslint and remove tslint --- .eslintrc.js | 1 + packages/api-rest/package.json | 3 ++- packages/api-rest/tslint.json | 45 ---------------------------------- 3 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 packages/api-rest/tslint.json diff --git a/.eslintrc.js b/.eslintrc.js index c6521a25d16..1bc0dc09891 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,6 +42,7 @@ module.exports = { 'analytics', // 'api', 'api-graphql', + // 'api-rest', 'auth', 'aws-amplify', 'core', diff --git a/packages/api-rest/package.json b/packages/api-rest/package.json index b28363f49e6..e2799f16230 100644 --- a/packages/api-rest/package.json +++ b/packages/api-rest/package.json @@ -21,7 +21,8 @@ "clean": "npm run clean:size && rimraf dist lib lib-esm", "clean:size": "rimraf dual-publish-tmp tmp*", "format": "echo \"Not implemented\"", - "lint": "tslint 'src/**/*.ts' && npm run ts-coverage", + "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage", + "lint:fix": "eslint '**/*.{ts,tsx}' --fix", "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 70.0" }, "exports": { diff --git a/packages/api-rest/tslint.json b/packages/api-rest/tslint.json deleted file mode 100644 index 1bb9e144d24..00000000000 --- a/packages/api-rest/tslint.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "defaultSeverity": "error", - "plugins": ["prettier"], - "extends": [], - "jsRules": {}, - "rules": { - "prefer-const": true, - "max-line-length": [true, 120], - "no-empty-interface": true, - "no-var-keyword": true, - "object-literal-shorthand": true, - "no-eval": true, - "space-before-function-paren": [ - true, - { - "anonymous": "never", - "named": "never" - } - ], - "no-parameter-reassignment": true, - "align": [true, "parameters"], - "no-duplicate-imports": true, - "one-variable-per-declaration": [false, "ignore-for-loop"], - "triple-equals": [true, "allow-null-check"], - "comment-format": [true, "check-space"], - "indent": [false], - "whitespace": [ - false, - "check-branch", - "check-decl", - "check-operator", - "check-preblock" - ], - "eofline": true, - "variable-name": [ - true, - "check-format", - "allow-pascal-case", - "allow-snake-case", - "allow-leading-underscore" - ], - "semicolon": [true, "always", "ignore-interfaces"] - }, - "rulesDirectory": [] -}