Skip to content

Commit 6450ee8

Browse files
committed
Include index.js and index.d.ts in linting.
1 parent df3d3dd commit 6450ee8

File tree

3 files changed

+212
-10
lines changed

3 files changed

+212
-10
lines changed

.eslintrc.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ module.exports = {
1414
overrides: [
1515
{
1616
// tests
17-
files: ['test/**/*.js'],
17+
files: ['test/**/*.js', 'test/**/*.ts'],
1818
env: {
19+
node: true,
1920
jest: true,
2021
},
2122
},
23+
{
24+
files: ['test/**/*.ts', 'index.d.ts'],
25+
parser: '@typescript-eslint/parser',
26+
parserOptions: {
27+
sourceType: "module",
28+
},
29+
}
2230
],
2331
};

package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"test": "test"
1414
},
1515
"dependencies": {
16-
"string-width": "^4.2.0"
16+
"string-width": "^4.2.0",
17+
"typescript": "<5"
1718
},
1819
"devDependencies": {
20+
"@typescript-eslint/parser": "^4.33.0",
1921
"cli-table": "^0.3.1",
2022
"eslint": "^6.0.0",
2123
"eslint-config-prettier": "^6.0.0",
@@ -31,7 +33,7 @@
3133
"scripts": {
3234
"changelog": "lerna-changelog",
3335
"docs": "node ./scripts/update-docs.js",
34-
"prettier": "prettier --write '{examples,lib,scripts,src,test}/**/*.js'",
36+
"prettier": "prettier --write index.js index.d.ts '{examples,lib,scripts,src,test}/**/*.js'",
3537
"test": "jest --color",
3638
"test:watch": "jest --color --watchAll --notify"
3739
},
@@ -82,11 +84,8 @@
8284
"runner": "jest-runner-eslint",
8385
"displayName": "lint",
8486
"testMatch": [
85-
"<rootDir>/examples/**/*.js",
86-
"<rootDir>/lib/**/*.js",
87-
"<rootDir>/scripts/**/*.js",
88-
"<rootDir>/src/**/*.js",
89-
"<rootDir>/test/**/*.js"
87+
"<rootDir>/**/*.js",
88+
"<rootDir>/**/*.ts"
9089
]
9190
}
9291
]

0 commit comments

Comments
 (0)