1 | @bigpopakap/eslint-config
|
2 | =========================
|
3 |
|
4 | Shared ESLint configurations for bigpopakap's personal projects.
|
5 |
|
6 | # Adding to a new repo
|
7 |
|
8 | ## Installation
|
9 |
|
10 | ```bash
|
11 | yarn add -D @bigpopakap/eslint-config
|
12 | ```
|
13 |
|
14 | ## Running
|
15 |
|
16 | Examples of how to run the linter:
|
17 | ```bash
|
18 | yarn eslint-bigpopakap
|
19 | yarn eslint-bigpopakap --fix
|
20 | ```
|
21 |
|
22 | ## Configuration
|
23 |
|
24 | Add the following `.eslintrc.js` to your project:
|
25 | ```js
|
26 | module.exports = {
|
27 | extends: [
|
28 | // Update `/***` to `/node`, `/react`, or another flavor, depending on what kind of project you have.
|
29 | '@bigpopakap/eslint-config/***'
|
30 | ],
|
31 |
|
32 | // Optional, but useful to help ESLint resolve absolute path imports,
|
33 | // matching whatever path is in your `tsconfig.json#compilerOptions#baseUrl`.
|
34 | settings: {
|
35 | "import/resolver": {
|
36 | node: {
|
37 | paths: ["src"]
|
38 | }
|
39 | },
|
40 | }
|
41 | };
|
42 | ```
|
43 |
|
44 | ## Useful scripts
|
45 |
|
46 | You may want to add the following scripts to your `package.json`:
|
47 | ```json
|
48 | {
|
49 | "scripts": {
|
50 | "lint": "npm-run-all -c lint:*",
|
51 | "lintfix": "npm-run-all -c lint:*:fix",
|
52 | "lint:js": "yarn eslint-bigpopakap",
|
53 | "lint:js:fix": "yarn lint:js --fix"
|
54 | }
|
55 | }
|
56 | ```
|