Skip to content

Commit ba438b7

Browse files
committed
Copy linter configuration from tc39/proposal-temporal
This wasn't in the polyfill/ directory so it didn't get copied in the fork. Re-import this linter configuration (with some adjustments to the paths)
1 parent f68cbde commit ba438b7

File tree

3 files changed

+106
-2
lines changed

3 files changed

+106
-2
lines changed

.eslintrc.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
env:
2+
browser: true
3+
es6: true
4+
node: true
5+
plugins:
6+
- prettier
7+
- '@typescript-eslint'
8+
extends:
9+
- 'eslint:recommended'
10+
- 'plugin:prettier/recommended'
11+
- 'plugin:@typescript-eslint/recommended'
12+
parser: '@typescript-eslint/parser' # for index.d.ts
13+
globals:
14+
Atomics: readonly
15+
BigInt: readonly
16+
SharedArrayBuffer: readonly
17+
globalThis: readonly
18+
parserOptions:
19+
ecmaVersion: 2020
20+
sourceType: module
21+
ignorePatterns:
22+
- node_modules/
23+
- /dist/
24+
rules:
25+
array-element-newline:
26+
- error
27+
- consistent
28+
arrow-parens: error
29+
arrow-spacing: error
30+
brace-style:
31+
- error
32+
- 1tbs
33+
comma-dangle: error
34+
comma-spacing: error
35+
curly:
36+
- error
37+
- multi-line
38+
func-call-spacing: error
39+
function-call-argument-newline:
40+
- error
41+
- consistent
42+
indent:
43+
- error
44+
- 2
45+
- SwitchCase: 1
46+
keyword-spacing: error
47+
max-len:
48+
- error
49+
- code: 120
50+
ignoreRegExpLiterals: true
51+
no-alert: error
52+
no-console: error
53+
no-multiple-empty-lines:
54+
- error
55+
- max: 1
56+
no-trailing-spaces: error
57+
object-curly-spacing:
58+
- error
59+
- always
60+
object-property-newline:
61+
- error
62+
- allowAllPropertiesOnSameLine: true
63+
quote-props:
64+
- error
65+
- as-needed
66+
quotes:
67+
- error
68+
- single
69+
- avoidEscape: true
70+
semi: error
71+
space-infix-ops: error
72+
'@typescript-eslint/explicit-module-boundary-types': off
73+
'@typescript-eslint/no-empty-function': off
74+
'@typescript-eslint/no-var-requires': off
75+
'@typescript-eslint/ban-ts-comment': off
76+
overrides:
77+
- files:
78+
- lib/duration.mjs
79+
- lib/init.js
80+
- test/all.mjs
81+
- test/exhaust.mjs
82+
- test/validStrings.mjs
83+
rules:
84+
no-console: off

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package-lock.json
22
node_modules/
33
dist/
4+
.eslintcache

package.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"test": "node --no-warnings --experimental-modules --icu-data-dir node_modules/full-icu --loader ./test/resolve.source.mjs ./test/all.mjs",
1111
"build": "rollup -c rollup.config.js",
1212
"prepublishOnly": "npm run build",
13-
"playground": "node --experimental-modules --no-warnings --icu-data-dir node_modules/full-icu -r ./lib/init.js"
13+
"playground": "node --experimental-modules --no-warnings --icu-data-dir node_modules/full-icu -r ./lib/init.js",
14+
"lint": "eslint . --ext js,mjs,.d.ts --max-warnings 0 --cache \"$@\"",
15+
"postlint": "npm run tscheck",
16+
"tscheck": "tsc index.d.ts --noEmit --strict --lib ESNext"
1417
},
1518
"keywords": [
1619
"Calendar",
@@ -60,12 +63,28 @@
6063
"@rollup/plugin-commonjs": "^15.1.0",
6164
"@rollup/plugin-node-resolve": "^9.0.0",
6265
"@rollup/plugin-replace": "^2.3.3",
66+
"@typescript-eslint/eslint-plugin": "^4.3.0",
67+
"@typescript-eslint/parser": "^4.3.0",
68+
"eslint": "^7.10.0",
69+
"eslint-config-prettier": "^6.12.0",
70+
"eslint-plugin-prettier": "^3.1.4",
6371
"full-icu": "^1.3.0",
72+
"prettier": "^2.1.2",
6473
"rollup": "^2.28.2",
6574
"rollup-plugin-terser": "^7.0.2",
66-
"timezones.json": "^1.5.2"
75+
"timezones.json": "^1.5.2",
76+
"typescript": "^4.0.3"
6777
},
6878
"engines": {
6979
"node": ">=12"
80+
},
81+
"prettier": {
82+
"printWidth": 120,
83+
"trailingComma": "none",
84+
"tabWidth": 2,
85+
"semi": true,
86+
"singleQuote": true,
87+
"bracketSpacing": true,
88+
"arrowParens": "always"
7089
}
7190
}

0 commit comments

Comments
 (0)