You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Explanation for using both `eslint` and `prettier`
6
+
7
+
Code style is handled with `eslint`, but _formatting_ is handled with `prettier`.
8
+
9
+
\<opinion>
10
+
Though `eslint` can format code, `prettier` is easier to configure for the sole purpose of formatting code _and_ is already assigned as a keyboard shortcut in VS Code for me _and_ it's muscle-memory for me to format before saving.
11
+
12
+
So that's why there's two formatters.
13
+
\</opinion>
14
+
15
+
Two packages are crucial in this rigamarole:
16
+
17
+
-`eslint-plugin-prettier`
18
+
-`eslint-config-prettier` (notice **config** in the name)
19
+
20
+
The `eslint-plugin-prettier` is an `eslint` plugin that runs `prettier` after fixing code style. `eslint-**config**-prettier` is an `eslint` config that overules and ignores any `eslint` formatting rules, leaving it all up to `prettier` for how the code should look.
21
+
22
+
Apparently, `eslint-config-prettier` is necessary to prevent `eslint` and `prettier` from bickering; more on [the repo page](https://github.com/prettier/eslint-plugin-prettier#recommended-configuration)
Copy file name to clipboardExpand all lines: src/core/Client.ts
+8-6
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ import { Chapters } from './api/api_chapter';
7
7
import{Voicelines}from'./api/api_voiceline';
8
8
import{datatype}from'./Data';
9
9
10
-
exporttypeSource='uncached'|'local'
10
+
exporttypeSource='uncached'|'local';
11
11
12
12
exportinterfaceCacheOptions{
13
13
source?: Source;
@@ -36,7 +36,7 @@ export class AzurAPI extends EventEmitter {
36
36
equipments: this.equipments,
37
37
chapters: this.chapters,
38
38
voicelines: this.voicelines,
39
-
barrages: this.barrages
39
+
barrages: this.barrages,
40
40
};
41
41
42
42
/**
@@ -46,7 +46,10 @@ export class AzurAPI extends EventEmitter {
46
46
constructor(options?: CacheOptions){
47
47
super();
48
48
//Make sure people are using Node <=14
49
-
if(parseFloat(process.version.replace('v',''))<=14)thrownewError('AzurAPI requires Node v14 or above, if you would like to use an older Node version, please use any version of this package below v0.2.13 (Not Recommended)');
'AzurAPI requires Node v14 or above, if you would like to use an older Node version, please use any version of this package below v0.2.13 (Not Recommended)'
0 commit comments