Skip to content

Commit 2660d27

Browse files
authored
Configure typescript, eslint and prettier caches (#5990)
1 parent 6322fc0 commit 2660d27

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ coverage/
2626

2727
# eslint
2828
.eslintcache
29+
/cache.tsbuildinfo
2930

3031
# Visual Studio exclusions
3132
*.suo

lint-staged.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ module.exports = async (allStagedFiles) => {
2020
eslintFiles.length &&
2121
`eslint --cache --fix ${eslintFiles.map(addQuotes).join(' ')}`,
2222
prettierFiles.length &&
23-
`prettier --write ${prettierFiles.map(addQuotes).join(' ')}`,
23+
`prettier --cache --write ${prettierFiles.map(addQuotes).join(' ')}`,
2424
].filter(Boolean);
2525
};

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
"serve": "http-server -o /demo .",
4141
"docs": "doctoc ./docs/API.md && api-documenter markdown -i api-extractor -o api-extractor/api-documenter && rm api-extractor/api-documenter/index.md && npm run docs-md-to-html",
4242
"docs-md-to-html": "generate-md --layout github --input api-extractor/api-documenter --output api-docs",
43-
"lint": "eslint src/ tests/ --ext .js --ext .ts",
43+
"lint": "eslint --cache src/ tests/ --ext .js --ext .ts",
4444
"lint:fix": "npm run lint -- --fix",
4545
"lint:quiet": "npm run lint -- --quiet",
4646
"lint:staged": "lint-staged",
47-
"prettier": "prettier --write .",
48-
"prettier:verify": "prettier --check .",
47+
"prettier": "prettier --cache --write .",
48+
"prettier:verify": "prettier --cache --check .",
4949
"pretest": "npm run lint",
5050
"sanity-check": "npm run lint && npm run prettier:verify && npm run type-check && npm run build && es-check && npm run docs && npm run test:unit",
5151
"start": "npm run dev",

tsconfig-lib.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"lib": ["dom", "es2015"],
1212
"outDir": "./lib/",
1313
"allowSyntheticDefaultImports": true,
14-
"emitDeclarationOnly": true
14+
"emitDeclarationOnly": true,
15+
"incremental": true,
16+
"tsBuildInfoFile": "cache.tsbuildinfo"
1517
},
1618
"include": ["src/**/*"],
1719
"exclude": ["node_modules", "dist/**/*", "demo/libs/**/*"]

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/* needed for eslint to work for some reason ¯\_(ツ)_/¯ */
1111
"tests/**/.eslintrc.js",
1212
"rollup.config.js",
13-
"build-config.js"
13+
"build-config.js",
14+
"lint-staged.config.js"
1415
]
1516
}

0 commit comments

Comments
 (0)