Add ESLint (#3)
This commit is contained in:
16
README.md
16
README.md
@@ -12,7 +12,7 @@ npm i
|
||||
|
||||
## Build
|
||||
|
||||
This sample uses the TypeScript compiler to produce JavaScript that runs in modern browsers, and [lit-analyzer](https://www.npmjs.com/package/lit-analyzer), a program that type-checks and lints lit-html templates.
|
||||
This sample uses the TypeScript compiler to produce JavaScript that runs in modern browsers.
|
||||
|
||||
To build the JavaScript version of your component:
|
||||
|
||||
@@ -40,7 +40,7 @@ npm test
|
||||
|
||||
## Dev Server
|
||||
|
||||
This sample uses [ES dev server](https://github.com/open-wc/open-wc/tree/master/packages/es-dev-server) for previewing the project without additional build steps. ES dev server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers.
|
||||
This sample uses open-wc's [es-dev-server](https://github.com/open-wc/open-wc/tree/master/packages/es-dev-server) for previewing the project without additional build steps. ES dev server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers.
|
||||
|
||||
To run the dev server and open the project in a new browser tab:
|
||||
|
||||
@@ -48,6 +48,18 @@ To run the dev server and open the project in a new browser tab:
|
||||
npm run serve
|
||||
```
|
||||
|
||||
## Linting
|
||||
|
||||
Linting of TypeScript files is provided by [ESLint](eslint.org) and [TypeScript ESLint](https://github.com/typescript-eslint/typescript-eslint). In addition, [lit-analyzer](https://www.npmjs.com/package/lit-analyzer) is used to type-check and lint lit-html templates.
|
||||
|
||||
The rules are mostly the recommended rules from each project, but some have been turned off to make LitElement usage easier. The recommended rules are pretty strict, so you may want to relax them by editing `.eslintrc.json` and `tsconfig.json`.
|
||||
|
||||
To lint the project run:
|
||||
|
||||
```bash
|
||||
npm run lint
|
||||
```
|
||||
|
||||
## More information
|
||||
|
||||
See [Get started](https://lit-element.polymer-project.org/guide/start) on the LitElement site for more information.
|
||||
|
||||
Reference in New Issue
Block a user