mirror of https://github.com/actions/cache.git
Add initial eslint setup (#88)
parent
31508256ff
commit
fb50aa45ec
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"env": { "node": true, "jest": true },
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": { "ecmaVersion": 2020, "sourceType": "module" },
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:import/errors",
|
||||||
|
"plugin:import/warnings",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
|
"prettier/@typescript-eslint"
|
||||||
|
],
|
||||||
|
"plugins": ["@typescript-eslint", "jest"]
|
||||||
|
}
|
@ -1,22 +1,23 @@
|
|||||||
require('nock').disableNetConnect();
|
require("nock").disableNetConnect();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ["js", "ts"],
|
||||||
testEnvironment: 'node',
|
testEnvironment: "node",
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ["**/*.test.ts"],
|
||||||
testRunner: 'jest-circus/runner',
|
testRunner: "jest-circus/runner",
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
"^.+\\.ts$": "ts-jest"
|
||||||
},
|
},
|
||||||
verbose: true
|
verbose: true
|
||||||
}
|
};
|
||||||
|
|
||||||
const processStdoutWrite = process.stdout.write.bind(process.stdout)
|
const processStdoutWrite = process.stdout.write.bind(process.stdout);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||||
process.stdout.write = (str, encoding, cb) => {
|
process.stdout.write = (str, encoding, cb) => {
|
||||||
// Core library will directly call process.stdout.write for commands
|
// Core library will directly call process.stdout.write for commands
|
||||||
// We don't want :: commands to be executed by the runner during tests
|
// We don't want :: commands to be executed by the runner during tests
|
||||||
if (!str.match(/^::/)) {
|
if (!str.match(/^::/)) {
|
||||||
return processStdoutWrite(str, encoding, cb);
|
return processStdoutWrite(str, encoding, cb);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue