Skip to content

Commit e03493f

Browse files
committed
Add eslint configuration
1 parent e1b41e6 commit e03493f

File tree

6 files changed

+88
-8
lines changed

6 files changed

+88
-8
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[*]
2+
end_of_line = lf
3+
insert_final_newline = true
4+
5+
[*.{js,json,scss,yml}]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true

.eslintrc.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
root: true
2+
3+
extends:
4+
- 'eslint:recommended'
5+
6+
parserOptions:
7+
ecmaVersion: 2022
8+
sourceType: module
9+
requireConfigFile: false
10+
11+
env:
12+
es2020: true
13+
node: true
14+
browser: true
15+
16+
rules:
17+
array-bracket-spacing: 2
18+
block-spacing: 2
19+
brace-style: [2, '1tbs', { allowSingleLine: true }]
20+
comma-dangle: 2
21+
comma-spacing: 2
22+
comma-style: 2
23+
complexity: [1, 16]
24+
dot-location: [2, 'property']
25+
eqeqeq: [2, 'smart']
26+
indent: [0, 2, { SwitchCase: 1 }]
27+
indent-legacy: [2, 2, { SwitchCase: 1 }]
28+
key-spacing: [1, { beforeColon: false, afterColon: true }]
29+
keyword-spacing: 2
30+
max-depth: [1, 6]
31+
max-len: [1, 80, 2, { ignoreComments: true, ignoreUrls: true, ignorePattern: "[`'\"\/],?$" }]
32+
max-nested-callbacks: [1, 4]
33+
no-caller: 2
34+
no-constant-condition: [2, { checkLoops: false }]
35+
no-eval: 2
36+
no-implied-eval: 2
37+
no-mixed-spaces-and-tabs: 2
38+
no-multi-str: 2
39+
no-shadow:
40+
[2, { allow: ['done', 'reject', 'resolve', 'conn', 'cb', 'err', 'error'] }]
41+
no-spaced-func: 2
42+
no-trailing-spaces: 2
43+
no-unexpected-multiline: 2
44+
no-unneeded-ternary: 2
45+
no-unreachable: 2
46+
no-useless-concat: 2
47+
no-unsafe-finally: 0
48+
object-curly-spacing: [2, 'always']
49+
operator-linebreak: [2, 'after']
50+
quote-props: [2, 'consistent-as-needed']
51+
quotes: [2, 'single', 'avoid-escape']
52+
radix: 2
53+
require-atomic-updates: 0
54+
semi-spacing: 0
55+
semi: [2, 'never']
56+
space-before-blocks: 2
57+
space-before-function-paren: [2, { anonymous: 'always', named: 'never' }]
58+
space-infix-ops: 2
59+
space-unary-ops: 2
60+
space-in-parens: 2
61+
wrap-regex: 2

.mocharc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
color: true
2+
recursive: true
3+
reporter: dot
4+
renderer: true
5+
require:
6+
- test/support/fixtures.js

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.15.0

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,9 @@
4242
"hint": "The template determines how to import the IIIF manifest metadata section"
4343
}
4444
],
45-
"mocha": {
46-
"color": true,
47-
"renderer": true,
48-
"require": [
49-
"test/support/fixtures.js"
50-
]
51-
},
5245
"devDependencies": {
5346
"electron": "^16.0.4",
5447
"electron-mocha": "^11.0.2",
55-
"jsonld": "^5.2.0"
48+
"eslint": "^8.14.0",
5649
}
5750
}

test/.eslintrc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# vi: set ft=yaml :
2+
env:
3+
mocha: true
4+
5+
globals:
6+
F: true
7+
8+
rules:
9+
no-console: 0
10+
max-nested-callbacks: [1, 8]

0 commit comments

Comments
 (0)