Skip to content

Commit

Permalink
Configure typescript, eslint and prettier caches (#5990)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson authored Nov 22, 2023
1 parent 6322fc0 commit 2660d27
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ coverage/

# eslint
.eslintcache
/cache.tsbuildinfo

# Visual Studio exclusions
*.suo
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ module.exports = async (allStagedFiles) => {
eslintFiles.length &&
`eslint --cache --fix ${eslintFiles.map(addQuotes).join(' ')}`,
prettierFiles.length &&
`prettier --write ${prettierFiles.map(addQuotes).join(' ')}`,
`prettier --cache --write ${prettierFiles.map(addQuotes).join(' ')}`,
].filter(Boolean);
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"serve": "http-server -o /demo .",
"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",
"docs-md-to-html": "generate-md --layout github --input api-extractor/api-documenter --output api-docs",
"lint": "eslint src/ tests/ --ext .js --ext .ts",
"lint": "eslint --cache src/ tests/ --ext .js --ext .ts",
"lint:fix": "npm run lint -- --fix",
"lint:quiet": "npm run lint -- --quiet",
"lint:staged": "lint-staged",
"prettier": "prettier --write .",
"prettier:verify": "prettier --check .",
"prettier": "prettier --cache --write .",
"prettier:verify": "prettier --cache --check .",
"pretest": "npm run lint",
"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",
"start": "npm run dev",
Expand Down
4 changes: 3 additions & 1 deletion tsconfig-lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"lib": ["dom", "es2015"],
"outDir": "./lib/",
"allowSyntheticDefaultImports": true,
"emitDeclarationOnly": true
"emitDeclarationOnly": true,
"incremental": true,
"tsBuildInfoFile": "cache.tsbuildinfo"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist/**/*", "demo/libs/**/*"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/* needed for eslint to work for some reason ¯\_(ツ)_/¯ */
"tests/**/.eslintrc.js",
"rollup.config.js",
"build-config.js"
"build-config.js",
"lint-staged.config.js"
]
}

0 comments on commit 2660d27

Please sign in to comment.