|
29 | 29 |
|
30 | 30 | 1. Install the dependency. |
31 | 31 |
|
32 | | -```bash |
33 | | -npm install --save-dev eslint-config-codely |
34 | | -``` |
| 32 | + ```bash |
| 33 | + npm install --save-dev eslint-config-codely |
| 34 | + ``` |
35 | 35 |
|
36 | 36 | 2. Add it to your `eslint.config.js`: |
37 | 37 |
|
38 | | -```js |
39 | | -import eslintConfigCodely from "eslint-config-codely"; |
40 | | - |
41 | | -export default [ |
42 | | - // If you're using js |
43 | | - ...eslintConfigCodely.js, |
44 | | - // Or if you're using ts. The ts config includes the js one, so you don't need to include it manually. |
45 | | - ...eslintConfigCodely.ts, |
46 | | - { |
47 | | - // Your config here |
48 | | - } |
49 | | -] |
50 | | -``` |
51 | | - |
52 | | -Also, you can use the `full` config, which includes the `js`, `ts` and very opinionated Codely configs. |
53 | | - |
54 | | -```js |
55 | | -import eslintConfigCodely from "eslint-config-codely"; |
56 | | - |
57 | | -export default [ |
58 | | - ...eslintConfigCodely.full, |
59 | | - { |
60 | | - // Your config here |
61 | | - } |
62 | | -] |
63 | | -``` |
64 | | - |
65 | | -We have a `course` setting. This is the same as the `full` config, but with a narrower width due to the zoom used in |
66 | | -videos: |
67 | | - |
68 | | -```js |
69 | | -import eslintConfigCodely from "eslint-config-codely"; |
70 | | - |
71 | | -export default [ |
72 | | - ...eslintConfigCodely.course, |
73 | | - { |
74 | | - // Your config here |
75 | | - } |
76 | | -] |
77 | | -``` |
78 | | - |
79 | | -ℹ️ Please note that some of the rules enabled by default require that you have `strict: true` in your `tsconfig.json`. |
| 38 | + ```js |
| 39 | + import eslintConfigCodely from "eslint-config-codely"; |
| 40 | + |
| 41 | + export default [ |
| 42 | + // If you're using js |
| 43 | + ...eslintConfigCodely.js, |
| 44 | + // Or if you're using ts. The ts config includes the js one, so you don't need to include it manually. |
| 45 | + ...eslintConfigCodely.ts, |
| 46 | + { |
| 47 | + // Your config here |
| 48 | + } |
| 49 | + ] |
| 50 | + ``` |
| 51 | + |
| 52 | + Also, you can use the `full` config, which includes the `js`, `ts` and very opinionated Codely configs. |
| 53 | + |
| 54 | + ```js |
| 55 | + import eslintConfigCodely from "eslint-config-codely"; |
| 56 | + |
| 57 | + export default [ |
| 58 | + ...eslintConfigCodely.full, |
| 59 | + { |
| 60 | + // Your config here |
| 61 | + } |
| 62 | + ] |
| 63 | + ``` |
| 64 | + |
| 65 | + We have a `course` setting. |
| 66 | + This is the same as the `full` config, but with a narrower width due to the zoom used during |
| 67 | +video recordings: |
| 68 | + |
| 69 | + ```js |
| 70 | + import eslintConfigCodely from "eslint-config-codely"; |
| 71 | + |
| 72 | + export default [ |
| 73 | + ...eslintConfigCodely.course, |
| 74 | + { |
| 75 | + // Your config here |
| 76 | + } |
| 77 | + ] |
| 78 | + ``` |
| 79 | + |
| 80 | +> [!NOTE] |
| 81 | +> Some rules enabled by default require `strict: true` to be set in your `tsconfig.json`. |
80 | 82 |
|
81 | 83 | ## 🤔 What it does |
82 | 84 |
|
|
0 commit comments