Skip to content

Commit 2dc747f

Browse files
author
Justin Kimbrell
committed
chore: added eslint config files
1 parent 5f78559 commit 2dc747f

File tree

4 files changed

+52
-3
lines changed

4 files changed

+52
-3
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!docs/.vitepress/

.eslintrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "no-only-tests", "eslint-comments"],
5+
"ignorePatterns": ["node_modules", "dist"],
6+
"parserOptions": {
7+
"project": "./tsconfig.json",
8+
"tsconfigRootDir": ".",
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
"indent": "warn",
13+
"keyword-spacing": "warn",
14+
"semi": "warn",
15+
"prefer-const": "warn",
16+
"no-console": "warn",
17+
"no-debugger": "warn",
18+
"no-only-tests/no-only-tests": "warn",
19+
"@typescript-eslint/no-unused-vars": [
20+
"warn",
21+
{
22+
"argsIgnorePattern": "^_",
23+
"varsIgnorePattern": "^_",
24+
"caughtErrorsIgnorePattern": "^_"
25+
}
26+
],
27+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
28+
"@typescript-eslint/no-unnecessary-condition": "warn",
29+
"@typescript-eslint/no-useless-empty-export": "warn",
30+
"eslint-comments/no-unused-disable": "warn"
31+
}
32+
}

test/faces/ElapsedTime.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ describe('ElapsedTime', () => {
1616
});
1717

1818
it('creates an elapsed time to a given date', () => {
19+
const date = new Date;
20+
1921
const instance = flipClock({
2022
parent: document.createElement('div'),
2123
face: elapsedTime({
22-
to: add(new Date, { seconds: 3 }),
24+
to: add(date, { seconds: 3 }),
2325
format: '[mm]:[ss]'
2426
}),
2527
theme: theme()
@@ -46,10 +48,12 @@ describe('ElapsedTime', () => {
4648
});
4749

4850
it('creates an elapsed time from a date in the past', () => {
51+
const date = new Date;
52+
4953
const instance = flipClock({
5054
parent: document.createElement('div'),
5155
face: elapsedTime({
52-
from: sub(new Date, { minutes: 60 }),
56+
from: sub(date, { minutes: 60 }),
5357
format: '[mm]:[ss]'
5458
}),
5559
theme: theme()
@@ -67,10 +71,12 @@ describe('ElapsedTime', () => {
6771
});
6872

6973
it('creates an elapsed time from a date in the future', () => {
74+
const date = new Date;
75+
7076
const instance = flipClock({
7177
parent: document.createElement('div'),
7278
face: elapsedTime({
73-
from: add(new Date, { minutes: 60 }),
79+
from: add(date, { minutes: 60 }),
7480
format: '[mm]:[ss]'
7581
}),
7682
theme: theme()

0 commit comments

Comments
 (0)