Skip to content

Commit 721b8de

Browse files
authored
Add eslint and update src to be compliant with lit repo's eslint ruleset (#144)
* Added eslint with identical settings to lit/lit repo. * Updated TypeScript src files to satisfy eslint. * Add the ResizeObserver.js polyfill to the .eslintignore
1 parent 227a2ee commit 721b8de

File tree

14 files changed

+9618
-7784
lines changed

14 files changed

+9618
-7784
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
packages/lit-virtualizer/LitVirtualizer.*
2+
packages/lit-virtualizer/Virtualizer.*
3+
packages/lit-virtualizer/lit-virtualizer.*
4+
packages/lit-virtualizer/virtualize.*
5+
packages/lit-virtualizer/test/**/*
6+
packages/lit-virtualizer/polyfills/resize-observer-polyfill/ResizeObserver.js
7+
packages/lit-virtualizer/src/polyfills/resize-observer-polyfill/ResizeObserver.js
8+
9+
packages/lit-virtualizer-examples/

.eslintrc.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/eslint-recommended",
5+
"plugin:@typescript-eslint/recommended"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"ecmaVersion": 2020,
10+
"sourceType": "module"
11+
},
12+
"plugins": [
13+
"eslint-plugin-import",
14+
"eslint-plugin-no-only-tests",
15+
"@typescript-eslint"
16+
],
17+
"env": {
18+
"browser": true
19+
},
20+
"rules": {
21+
"import/extensions": ["error", "always"],
22+
"no-prototype-builtins": "off",
23+
"no-only-tests/no-only-tests": "error",
24+
"@typescript-eslint/ban-types": "off",
25+
"@typescript-eslint/explicit-module-boundary-types": "off",
26+
"@typescript-eslint/no-empty-function": "off",
27+
"@typescript-eslint/no-explicit-any": "error",
28+
"@typescript-eslint/no-non-null-assertion": "off",
29+
"@typescript-eslint/no-unused-vars": [
30+
"warn",
31+
{
32+
"argsIgnorePattern": "^_"
33+
}
34+
]
35+
},
36+
"overrides": [
37+
{
38+
"files": [
39+
"check-version-tracker.js",
40+
"rollup-common.js",
41+
"rollup.config.js",
42+
"web-test-runner.config.js"
43+
],
44+
"env": {
45+
"node": true
46+
}
47+
}
48+
]
49+
}

0 commit comments

Comments
 (0)