Skip to content

Commit

Permalink
use eslint directly, without gts
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Mar 1, 2024
1 parent fe70fad commit de6eddb
Show file tree
Hide file tree
Showing 5 changed files with 1,341 additions and 3,123 deletions.
2 changes: 1 addition & 1 deletion docs/developer/code-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We use following tools and settings for each check and formatting:
| code | tools | setting |
|---------|------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| go | [golangci-lint](https://github.com/golangci/golangci-lint) | [`.golangci.yml`](../../.golangci.yml) |
| ts | [gts](https://github.com/google/gts) | [`.eslintrc.yaml`](../../.eslintrc.yaml) and [`.prettierrc.js`](../../.prettierrc.js) |
| ts | [eslint](https://eslint.org) | [`.eslintrc.yaml`](../../.eslintrc.yaml) and [`.prettierrc.js`](../../.prettierrc.js) |
| scss | [stylelint](https://github.com/stylelint/stylelint) | [`.stylelintrc.yaml`](../../.stylelintrc.yaml) |
| html | [prettier](https://prettier.io/) | [`.jsbeautifyrc`](../../.jsbeautifyrc) |
| license | [license-check-and-add](https://github.com/awjh/license-check-and-add) | [`license-checker-config.json`](../../license-checker-config.json) |
Expand Down
50 changes: 44 additions & 6 deletions modules/web/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

root: true
parser: "@typescript-eslint/parser"
parserOptions:
Expand All @@ -22,20 +22,61 @@ parserOptions:
- cypress/tsconfig.json
sourceType: module
extends:
- "./node_modules/gts"
- prettier
- eslint:recommended
- plugin:node/recommended
- plugin:@typescript-eslint/recommended
- plugin:@angular-eslint/recommended
plugins:
- rxjs
- node
- prettier
rules:
"@typescript-eslint/no-unused-vars":
- error
- argsIgnorePattern: "^_"
"@typescript-eslint/ban-ts-comment": off
"@typescript-eslint/ban-ts-comment": warn
"@typescript-eslint/no-non-null-assertion": off
"@typescript-eslint/no-use-before-define": off
"@typescript-eslint/no-warning-comments": off
"@typescript-eslint/no-empty-function": off
"@typescript-eslint/no-var-requires": off
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/explicit-module-boundary-types": off
"@typescript-eslint/ban-types": off
"@typescript-eslint/camelcase": off
"@typescript-eslint/interface-name-prefix": off
"@typescript-eslint/no-namespace": off
"@typescript-eslint/no-this-alias": off
"@typescript-eslint/no-explicit-any": off
"@angular-eslint/no-host-metadata-property": off
node/no-missing-import: off
node/no-empty-function: off
node/no-unpublished-import: off
node/no-extraneous-require: error
node/no-unpublished-require: error
node/no-unsupported-features/es-syntax: off
node/no-missing-require: off
node/shebang: off
prettier/prettier: error
block-scoped-var: error
eqeqeq: error
no-var: error
prefer-const: error
prefer-arrow-callback: error
no-trailing-spaces: error
quotes:
- "warn"
- "single"
- avoidEscape: true
no-restricted-properties:
- "error"
- object: describe
property: only
- object: it
property: only
no-dupe-class-members: off
require-atomic-updates: off
no-undef: off
no-inner-declarations: off
no-redeclare: off
Expand All @@ -44,8 +85,6 @@ rules:
no-prototype-builtins: off
no-extra-boolean-cast: error
no-else-return: error
node/no-extraneous-require: error
node/no-unpublished-require: error
prefer-rest-params: error
rxjs/ban-operators:
- error
Expand All @@ -54,6 +93,5 @@ rules:
rxjs/no-unbound-methods: error
rxjs/no-unsafe-takeuntil: error
rxjs/no-nested-subscribe: error
"@angular-eslint/no-host-metadata-property": off
ignorePatterns:
- "**/*.js"
5 changes: 4 additions & 1 deletion modules/web/.prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*
*/
module.exports = {
...require('gts/.prettierrc.json'),
bracketSpacing: false,
singleQuote: true,
trailingComma: "es5",
arrowParens: "avoid",
semi: true,
printWidth: 120,
}
9 changes: 5 additions & 4 deletions modules/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"fix:i18n": "ng run kubernetes-dashboard:extract-i18n-merge",
"fix:html": "npx html-beautify -f src/**/*.html",
"fix:scss": "stylelint src/**/*.scss",
"fix:ts": "gts fix",
"fix:ts": "eslint . --fix",
"check": "yarn check:i18n && yarn check:html && yarn check:scss && yarn check:ts",
"check:i18n": "yarn fix:i18n",
"check:html": "./hack/check-html.sh",
"check:scss": "stylelint src/**/*.scss --fix",
"check:ts": "gts lint",
"check:ts": "eslint .",
"test": "npx jest -c jest.config.js",
"coverage": "npx jest -c jest.config.js --coverage",
"cypress": "wait-on -v -i 10000 http-get://127.0.0.1:8080/api/v1/node http://127.0.0.1:8080/config http://127.0.0.1:8080 && npx cypress run",
Expand All @@ -35,7 +35,7 @@
},
"lint-staged": {
"src/**/*.ts": [
"gts fix"
"eslint --fix"
],
"src/**/*.scss": [
"stylelint --fix"
Expand Down Expand Up @@ -108,11 +108,11 @@
"cypress-fail-fast": "7.1.0",
"del": "7.1.0",
"eslint": "8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-rxjs": "5.0.3",
"git-describe": "4.1.1",
"gts": "5.2.0",
"husky": "9.0.11",
"jasmine-core": "5.1.2",
"jasmine-spec-reporter": "7.0.0",
Expand All @@ -126,6 +126,7 @@
"minimist": "1.2.8",
"ng-extract-i18n-merge": "2.10.0",
"node-gyp": "10.0.1",
"prettier": "^3.2.5",
"q": "1.5.1",
"raw-loader": "4.0.2",
"run-node": "2.0.0",
Expand Down
Loading

0 comments on commit de6eddb

Please sign in to comment.