Skip to content

Commit 95e9706

Browse files
committedApr 20, 2020
feat: typescript preset
BREAKING CHANGE: includes extra dev packages for typescript
1 parent 258ef98 commit 95e9706

File tree

9 files changed

+1731
-818
lines changed

9 files changed

+1731
-818
lines changed
 

Diff for: ‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
node_modules
1+
node_modules
2+
*.log
3+
.npmrc

Diff for: ‎.releaserc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"branch": "master",
2+
"branches": ["master"],
33
"analyzeCommits": {
44
"preset": "angular",
55
"releaseRules": [

Diff for: ‎index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
3636
},
3737
parserOptions: {
38-
ecmaVersion: 2018
38+
ecmaVersion: 2019
3939
},
4040
plugins: [
4141
'promise',

Diff for: ‎package.json

+18-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Makeomatic base JS ESLint config, following our styleguide",
55
"main": "index.js",
66
"scripts": {
7-
"test": "eslint .",
7+
"test": "yarn eslint:js && yarn eslint:ts",
8+
"eslint:js": "eslint ./tests",
9+
"eslint:ts": "eslint --ext .ts ./tests -c ./typescript.js",
810
"semantic-release": "semantic-release"
911
},
1012
"repository": {
@@ -26,21 +28,28 @@
2628
},
2729
"homepage": "https://github.com/makeomatic/eslint-config-makeomatic#readme",
2830
"dependencies": {
29-
"eslint": "6.5.1",
30-
"eslint-config-airbnb-base": "14.0.0",
31-
"eslint-plugin-import": "2.18.2",
31+
"@typescript-eslint/eslint-plugin": "^2.29.0",
32+
"@typescript-eslint/parser": "^2.29.0",
33+
"eslint": "6.8.0",
34+
"eslint-config-airbnb-base": "14.1.0",
35+
"eslint-plugin-import": "2.20.2",
3236
"eslint-plugin-promise": "4.2.1",
33-
"eslint-plugin-unicorn": "^12.1.0"
37+
"eslint-plugin-unicorn": "^18.0.1"
3438
},
3539
"devDependencies": {
36-
"@makeomatic/deploy": "^9.3.2",
37-
"babel-plugin-istanbul": "^5.2.0",
38-
"cross-env": "^6.0.3"
40+
"@makeomatic/deploy": "^10.1.4",
41+
"babel-plugin-istanbul": "^6.0.0",
42+
"cross-env": "^7.0.2",
43+
"typescript": "^3.8.3"
3944
},
4045
"husky": {
4146
"hooks": {
4247
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
4348
"prepare-commit-msg": "./node_modules/@makeomatic/deploy/git-hooks/prepare-commit-msg $HUSKY_GIT_PARAMS"
4449
}
45-
}
50+
},
51+
"files": [
52+
"index.js",
53+
"typescript.js"
54+
]
4655
}

Diff for: ‎test.js renamed to ‎tests/test.js

File renamed without changes.

Diff for: ‎tests/test.ts

Whitespace-only changes.

Diff for: ‎tsconfig.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2019",
4+
"module": "commonjs",
5+
"moduleResolution": "node",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"sourceMap": true,
9+
"strict": true,
10+
"noImplicitAny": true,
11+
"noImplicitThis": true,
12+
"alwaysStrict": true,
13+
"noUnusedLocals": true,
14+
"noUnusedParameters": true,
15+
"noImplicitReturns": true,
16+
"noFallthroughCasesInSwitch": true,
17+
"esModuleInterop": true,
18+
"resolveJsonModule": true
19+
}
20+
}

Diff for: ‎typescript.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
env: {
3+
browser: false,
4+
es6: true,
5+
node: true
6+
},
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
project: 'tsconfig.json',
10+
sourceType: 'module'
11+
},
12+
plugins: [
13+
'@typescript-eslint'
14+
],
15+
extends: [
16+
'eslint:recommended',
17+
'plugin:@typescript-eslint/eslint-recommended',
18+
'plugin:@typescript-eslint/recommended'
19+
],
20+
rules: {
21+
semi: [
22+
'error',
23+
'never'
24+
],
25+
'no-console': [
26+
'error'
27+
],
28+
'@typescript-eslint/no-explicit-any': 'off',
29+
'@typescript-eslint/explicit-function-return-type': 'off'
30+
}
31+
};

Diff for: ‎yarn.lock

+1,657-806
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.