mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Start linting with lit-analyzer (#19302)
This commit is contained in:
parent
ec2ae15e3f
commit
e0f578c135
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -48,6 +48,8 @@ jobs:
|
|||||||
run: yarn run lint:eslint --quiet
|
run: yarn run lint:eslint --quiet
|
||||||
- name: Run tsc
|
- name: Run tsc
|
||||||
run: yarn run lint:types
|
run: yarn run lint:types
|
||||||
|
- name: Run lit-analyzer
|
||||||
|
run: yarn run lint:lit --quiet
|
||||||
- name: Run prettier
|
- name: Run prettier
|
||||||
run: yarn run lint:prettier
|
run: yarn run lint:prettier
|
||||||
test:
|
test:
|
||||||
|
@ -2,6 +2,7 @@ export default {
|
|||||||
"*.?(c|m){js,ts}": [
|
"*.?(c|m){js,ts}": [
|
||||||
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
|
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
|
||||||
"prettier --cache --write",
|
"prettier --cache --write",
|
||||||
|
"lit-analyzer",
|
||||||
],
|
],
|
||||||
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
|
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
|
||||||
"translations/*/*.json": (files) =>
|
"translations/*/*.json": (files) =>
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
"lint:prettier": "prettier . --cache --check",
|
"lint:prettier": "prettier . --cache --check",
|
||||||
"format:prettier": "prettier . --cache --write",
|
"format:prettier": "prettier . --cache --write",
|
||||||
"lint:types": "tsc",
|
"lint:types": "tsc",
|
||||||
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
|
"lint:lit": "lit-analyzer \"{.,*}/src/**/*.ts\"",
|
||||||
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
|
"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",
|
"format": "yarn run format:eslint && yarn run format:prettier",
|
||||||
"postinstall": "husky install",
|
"postinstall": "husky install",
|
||||||
"prepack": "pinst --disable",
|
"prepack": "pinst --disable",
|
||||||
|
@ -25,15 +25,25 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "ts-lit-plugin",
|
"name": "ts-lit-plugin",
|
||||||
"strict": false,
|
"strict": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-unknown-tag-name": "error",
|
// Custom elements
|
||||||
"no-missing-import": "error",
|
"no-unclosed-tag": "warning",
|
||||||
"no-unclosed-tag": "error",
|
|
||||||
"no-incompatible-type-binding": "warning",
|
|
||||||
"no-invalid-css": "warning",
|
|
||||||
"no-missing-element-type-definition": "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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user