UNPKG

3.66 kBMarkdownView Raw
1# eslint-config
2
3[![NPM Version](https://badge.fury.io/js/%40chatie%2Feslint-config.svg)](https://www.npmjs.com/package/@chatie/eslint-config)
4[![npm (tag)](https://img.shields.io/npm/v/%40chatie/eslint-config/next.svg)](https://www.npmjs.com/package/@chatie/eslint-config?activeTab=versions)
5[![NPM](https://github.com/Chatie/eslint-config/workflows/NPM/badge.svg)](https://github.com/Chatie/eslint-config/actions?query=workflow%3ANPM)
6
7ESLint Sharable Rules in TypeScript Standard Style
8
9![ESLint Sharable Rules in TypeScript Standard Style](https://chatie.github.io/eslint-config/images/eslint-config-chatie.jpg)
10> Source: [Using ESLint and Prettier in a TypeScript Project](https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project)
11
12## USAGE
13
141. Install `@chatie/eslint-config`
15
16```sh
17npm install --save-dev @chatie/eslint-config
18```
19
202. It will automatically generate a `.eslintrc.js` for you (if there's no such file before)
21
22It will contains the following content:
23
24```js
25module.exports = {
26 extends: '@chatie',
27}
28```
29
30### 3. You are All Set
31
32```sh
33./node_modules/.bin/eslint
34```
35
36`eslint` will work and follow the @chatie rules.
37
38## STYLES
39
40- [JavaScript Standard Style](https://standardjs.com)
41 - [ESLint Config for JavaScript Standard Style](https://github.com/standard/eslint-config-standard)
42
43## SEE ALSO
44
45- [ESLint Shareable Configs](https://eslint.org/docs/developer-guide/shareable-configs)
46- [Using ESLint with TypeScript in 2019](https://43081j.com/2019/02/using-eslint-with-typescript)
47- [From TSLint to ESLint, or How I Learned to Lint GraphQL Code](https://artsy.github.io/blog/2019/01/29/from-tslint-to-eslint/)
48
49### tslint -> eslint
50
51- [Roadmap: TSLint -> ESLint #4534](https://github.com/palantir/tslint/issues/4534)
52- [Roadmap: tslint-microsoft-contrib -> ESLint #876](https://github.com/microsoft/tslint-microsoft-contrib/issues/876)
53- [The future of TypeScript on ESLint](https://eslint.org/blog/2019/01/future-typescript-eslint)
54- [ESLint Plugin TSLint](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint)
55
56## FAQ
57
58### 1. `vscode` not linting TypeScript files at all
59
60Add the following config to `.vscode/settings.json` to enable linting TypeScript files:
61
62```json
63 "eslint.validate": [
64 "javascript",
65 "typescript",
66 ],
67```
68
69## HISTORY
70
71### main v1.0 (Oct 20, 2021)
72
731. Sep 18: Clean TSLint...
74
75### v0.14
76
771. Enforce Common JS ([#54](https://github.com/Chatie/eslint-config/issues/54))
781. Upgrade ESLint
79
80### v0.11 (Jun 30, 2020)
81
821. Update dependencies to latest.
831. Support `Nullish coalescing operator (??)`
84
85### v0.6 (08 Jun, 2019)
86
871. Add rule [no-floating-promises](https://github.com/typescript-eslint/typescript-eslint/pull/495)
881. Add rule set (recommended) from [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise)
891. Add dependence of [file-name-linter](https://npmjs.com/package/file-name-linter) to lint file names.
901. Add dependence of [markdownlint-cli](https://npmjs.com/package/markdownlint-cli) to lint markdown.
911. Auto generate `.eslintrc.js` in the project root directory after install if it not exists.
921. First beta
93
94### v0.0.1 (07 Jun 2019)
95
961. Converted tsling.json to .eslintrc.js with the JavaScript Standard Style.
97
98## AUTHOR
99
100[Huan LI (李卓桓)](http://linkedin.com/in/zixia) zixia@zixia.net
101
102[![Profile of Huan LI (李卓桓) on StackOverflow](https://stackexchange.com/users/flair/265499.png)](https://stackexchange.com/users/265499)
103
104## COPYRIGHT & LICENSE
105
106- Code & Docs © 2019 - now Huan LI zixia@zixia.net
107- Code released under the Apache-2.0 License
108- Docs released under Creative Commons