Start linting with lit-analyzer (#19302)

This commit is contained in:
Steve Repsher 2024-01-08 08:26:25 -05:00 committed by GitHub
parent ec2ae15e3f
commit e0f578c135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 9 deletions

View File

@ -48,6 +48,8 @@ jobs:
run: yarn run lint:eslint --quiet
- name: Run tsc
run: yarn run lint:types
- name: Run lit-analyzer
run: yarn run lint:lit --quiet
- name: Run prettier
run: yarn run lint:prettier
test:

View File

@ -2,6 +2,7 @@ export default {
"*.?(c|m){js,ts}": [
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
"prettier --cache --write",
"lit-analyzer",
],
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
"translations/*/*.json": (files) =>

View File

@ -13,8 +13,8 @@
"lint:prettier": "prettier . --cache --check",
"format:prettier": "prettier . --cache --write",
"lint:types": "tsc",
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
"lint:lit": "lit-analyzer \"{.,*}/src/**/*.ts\"",
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types && yarn run lint:lit",
"format": "yarn run format:eslint && yarn run format:prettier",
"postinstall": "husky install",
"prepack": "pinst --disable",

View File

@ -25,15 +25,25 @@
"plugins": [
{
"name": "ts-lit-plugin",
"strict": false,
"strict": true,
"rules": {
"no-unknown-tag-name": "error",
"no-missing-import": "error",
"no-unclosed-tag": "error",
"no-incompatible-type-binding": "warning",
"no-invalid-css": "warning",
// Custom elements
"no-unclosed-tag": "warning",
"no-missing-element-type-definition": "warning",
"no-property-visibility-mismatch": "error"
// Binding names
"no-legacy-attribute": "error",
// Binding types
"no-boolean-in-attribute-binding": "warning",
"no-expressionless-property-binding": "warning",
"no-complex-attribute-binding": "warning",
"no-nullable-attribute-binding": "warning",
"no-incompatible-type-binding": "warning",
"no-invalid-directive-binding": "warning",
// LitElement
"no-incompatible-property-type": "warning",
"no-property-visibility-mismatch": "warning",
// CSS
"no-invalid-css": "off" // warning does not work
}
}
]