Skip to content

Commit e80895f

Browse files
committed
Support TypeScript & use Prettier
1 parent 9e99077 commit e80895f

File tree

4 files changed

+136
-115
lines changed

4 files changed

+136
-115
lines changed

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"arrowParens": "always",
3+
"semi": false,
4+
"singleQuote": true
5+
}

index.js

+8-110
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,23 @@
11
'use strict'
22

3-
const WARN = 1
4-
const ERROR = 2
5-
63
module.exports = {
7-
extends: 'eslint:recommended',
4+
extends: [
5+
'plugin:@typescript-eslint/recommended',
6+
'prettier',
7+
'prettier/@typescript-eslint'
8+
],
89

910
env: {
1011
browser: true,
1112
node: true,
1213
es6: true
1314
},
1415

15-
parser: 'babel-eslint',
16+
parser: '@typescript-eslint/parser',
1617

17-
plugins: [
18-
'formatting'
19-
],
18+
plugins: ['@typescript-eslint'],
2019

2120
rules: {
22-
'accessor-pairs': ERROR,
23-
'array-bracket-spacing': [WARN, 'never'],
24-
'array-callback-return': WARN,
25-
'arrow-body-style': [WARN, 'as-needed'],
26-
'arrow-parens': [WARN, 'always'],
27-
'arrow-spacing': WARN,
28-
'block-scoped-var': WARN,
29-
'brace-style': WARN,
30-
'comma-dangle': 0,
31-
'comma-spacing': WARN,
32-
'curly': WARN,
33-
'dot-location': [WARN, 'property'],
34-
'dot-notation': WARN,
35-
'eqeqeq': [WARN, 'smart'],
36-
'indent': [WARN, 2],
37-
'key-spacing': [WARN, {
38-
beforeColon: false,
39-
afterColon: true,
40-
mode: 'minimum'
41-
}],
42-
'keyword-spacing': WARN,
43-
'max-len': [WARN, {
44-
code: 120,
45-
tabWidth: 2,
46-
ignoreComments: true,
47-
ignoreUrls: true,
48-
ignoreStrings: true,
49-
ignoreTemplateLiterals: true,
50-
ignoreRegExpLiterals: true
51-
}],
52-
'max-lines': [WARN, 500],
53-
'max-depth': [WARN, 4],
54-
'max-nested-callbacks': [WARN, 10],
55-
'newline-per-chained-call': [WARN, {
56-
ignoreChainWithDepth: 3
57-
}],
58-
'no-alert': ERROR,
59-
'no-caller': ERROR,
60-
'no-console': WARN,
61-
'no-const-assign': ERROR,
62-
'no-template-curly-in-string': WARN,
63-
'no-debugger': WARN,
64-
'no-empty-function': WARN,
65-
'no-empty-pattern': WARN,
66-
'no-eval': ERROR,
67-
'no-extra-bind': WARN,
68-
'no-extra-label': WARN,
69-
'no-floating-decimal': WARN,
70-
'no-global-assign': ERROR,
71-
'no-implicit-coercion': ERROR,
72-
'no-invalid-this': ERROR,
73-
'no-lone-blocks': ERROR,
74-
'no-loop-func': WARN,
75-
// 'no-magic-numbers': [ERROR, {
76-
// detectObjects: true,
77-
// ignoreArrayIndexes: true,
78-
// ignore: [-1, 0, 1, 2]
79-
// }],
80-
'no-multi-spaces': [WARN, {
81-
ignoreEOLComments: true
82-
}],
83-
'no-multiple-empty-lines': [WARN, {
84-
max: 2,
85-
maxBOF: 0,
86-
maxEOF: 1
87-
}],
88-
'no-new-func': ERROR,
89-
'no-new-wrappers': ERROR,
90-
'no-return-assign': WARN,
91-
'no-self-compare': ERROR,
92-
'no-sequences': ERROR,
93-
'no-throw-literal': ERROR,
94-
'no-trailing-spaces': WARN,
95-
'no-unmodified-loop-condition': WARN,
96-
'no-unused-expressions': [WARN, {
97-
'allowTernary': true
98-
}],
99-
'no-unused-vars': WARN,
100-
'no-useless-call': ERROR,
101-
'no-var': ERROR,
102-
'no-with': ERROR,
103-
'object-curly-spacing': [WARN, 'always'],
104-
'object-shorthand': [WARN, 'always'],
105-
'prefer-arrow-callback': WARN,
106-
'prefer-const': WARN,
107-
'quotes': [WARN, 'single'],
108-
'require-await': ERROR,
109-
'semi': [WARN, 'never'],
110-
'space-before-blocks': WARN,
111-
'space-before-function-paren': [WARN, {
112-
anonymous: 'never',
113-
named: 'never',
114-
asyncArrow: 'always'
115-
}],
116-
'space-in-parens': WARN,
117-
'space-infix-ops': WARN,
118-
'strict': [ERROR, 'global'],
119-
'yoda': [WARN, 'never', {
120-
exceptRange: true
121-
}],
122-
123-
'formatting/newline-object-in-array': WARN
21+
'no-console': ['error', { allow: ['error', 'info', 'warn'] }]
12422
}
12523
}

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
22
"name": "eslint-config-profiscience",
3-
"version": "2.0.4",
3+
"version": "3.0.0",
44
"description": "Shareable ESLint Config for Profisciencē",
55
"main": "index.js",
66
"keywords": [
77
"eslint",
88
"eslintconfig"
99
],
10-
"author": "Casey Webb <[email protected]>",
10+
"author": "Casey Webb <[email protected]> (https://caseyWebb.xyz)",
1111
"license": "WTFPL",
1212
"dependencies": {
13-
"babel-eslint": "^8.0.0",
14-
"eslint-plugin-formatting": "0.0.4"
13+
"@typescript-eslint/eslint-plugin": "^1.10.2",
14+
"@typescript-eslint/parser": "^1.10.2",
15+
"eslint-config-prettier": "^5.0.0"
1516
},
1617
"peerDependencies": {
17-
"eslint": "^4.0.0"
18+
"eslint": "^5.0.0",
19+
"prettier": "^1.0.0"
1820
}
1921
}

yarn.lock

+116
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22
# yarn lockfile v1
33

44

5+
"@types/eslint-visitor-keys@^1.0.0":
6+
version "1.0.0"
7+
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
8+
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
9+
10+
"@typescript-eslint/eslint-plugin@^1.10.2":
11+
version "1.10.2"
12+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz#552fc64cfcb19c6162190360217c945e8faa330a"
13+
integrity sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw==
14+
dependencies:
15+
"@typescript-eslint/experimental-utils" "1.10.2"
16+
eslint-utils "^1.3.1"
17+
functional-red-black-tree "^1.0.1"
18+
regexpp "^2.0.1"
19+
tsutils "^3.7.0"
20+
21+
"@typescript-eslint/[email protected]":
22+
version "1.10.2"
23+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz#cd548c03fc1a2b3ba5c136d1599001a1ede24215"
24+
integrity sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg==
25+
dependencies:
26+
"@typescript-eslint/typescript-estree" "1.10.2"
27+
eslint-scope "^4.0.0"
28+
29+
"@typescript-eslint/parser@^1.10.2":
30+
version "1.10.2"
31+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.10.2.tgz#36cfe8c6bf1b6c1dd81da56f88c8588f4b1a852b"
32+
integrity sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ==
33+
dependencies:
34+
"@types/eslint-visitor-keys" "^1.0.0"
35+
"@typescript-eslint/experimental-utils" "1.10.2"
36+
"@typescript-eslint/typescript-estree" "1.10.2"
37+
eslint-visitor-keys "^1.0.0"
38+
39+
"@typescript-eslint/[email protected]":
40+
version "1.10.2"
41+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz#8403585dd74b6cfb6f78aa98b6958de158b5897b"
42+
integrity sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw==
43+
dependencies:
44+
lodash.unescape "4.0.1"
45+
semver "5.5.0"
46+
547
ansi-styles@^3.1.0:
648
version "3.2.0"
749
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88"
@@ -107,14 +149,61 @@ escape-string-regexp@^1.0.5:
107149
version "1.0.5"
108150
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
109151

152+
eslint-config-prettier@^5.0.0:
153+
version "5.0.0"
154+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-5.0.0.tgz#f7a94b2b8ae7cbf25842c36fa96c6d32cd0a697c"
155+
integrity sha512-c17Aqiz5e8LEqoc/QPmYnaxQFAHTx2KlCZBPxXXjEMmNchOLnV/7j0HoPZuC+rL/tDC9bazUYOKJW9bOhftI/w==
156+
dependencies:
157+
get-stdin "^6.0.0"
158+
110159
111160
version "0.0.4"
112161
resolved "https://registry.yarnpkg.com/eslint-plugin-formatting/-/eslint-plugin-formatting-0.0.4.tgz#0e9b0fb478f6890c2e460c669698411d922ddd44"
113162

163+
eslint-scope@^4.0.0:
164+
version "4.0.3"
165+
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
166+
integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==
167+
dependencies:
168+
esrecurse "^4.1.0"
169+
estraverse "^4.1.1"
170+
171+
eslint-utils@^1.3.1:
172+
version "1.3.1"
173+
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"
174+
integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==
175+
176+
eslint-visitor-keys@^1.0.0:
177+
version "1.0.0"
178+
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
179+
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
180+
181+
esrecurse@^4.1.0:
182+
version "4.2.1"
183+
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
184+
integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==
185+
dependencies:
186+
estraverse "^4.1.0"
187+
188+
estraverse@^4.1.0, estraverse@^4.1.1:
189+
version "4.2.0"
190+
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13"
191+
integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=
192+
114193
esutils@^2.0.2:
115194
version "2.0.2"
116195
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
117196

197+
functional-red-black-tree@^1.0.1:
198+
version "1.0.1"
199+
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
200+
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
201+
202+
get-stdin@^6.0.0:
203+
version "6.0.0"
204+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
205+
integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==
206+
118207
globals@^10.0.0:
119208
version "10.1.0"
120209
resolved "https://registry.yarnpkg.com/globals/-/globals-10.1.0.tgz#4425a1881be0d336b4a823a82a7be725d5dd987c"
@@ -133,6 +222,11 @@ js-tokens@^3.0.0:
133222
version "3.0.2"
134223
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
135224

225+
226+
version "4.0.1"
227+
resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c"
228+
integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=
229+
136230
lodash@^4.2.0:
137231
version "4.17.11"
138232
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
@@ -147,6 +241,16 @@ ms@^2.1.1:
147241
version "2.1.2"
148242
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
149243

244+
regexpp@^2.0.1:
245+
version "2.0.1"
246+
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f"
247+
integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==
248+
249+
250+
version "5.5.0"
251+
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
252+
integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==
253+
150254
supports-color@^4.0.0:
151255
version "4.4.0"
152256
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e"
@@ -156,3 +260,15 @@ supports-color@^4.0.0:
156260
to-fast-properties@^2.0.0:
157261
version "2.0.0"
158262
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
263+
264+
tslib@^1.8.1:
265+
version "1.10.0"
266+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
267+
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
268+
269+
tsutils@^3.7.0:
270+
version "3.14.0"
271+
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77"
272+
integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==
273+
dependencies:
274+
tslib "^1.8.1"

0 commit comments

Comments
 (0)