Set up eslint for test files. (#517)

This commit is contained in:
Axel Hecht 2020-12-07 16:12:15 +01:00 committed by GitHub
parent 560e416032
commit c4d24de7a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 2 deletions

View File

@ -5,7 +5,7 @@
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
"project": "./tsconfig.lint.json"
},
"globals": {
"fetch": true

View File

@ -1,3 +1,4 @@
/* eslint-disable import/first */
// Initial env variable setup for tests.
process.env['INPUT_FOLDER'] = 'build'
process.env['GITHUB_SHA'] = '123'
@ -23,6 +24,7 @@ jest.mock('@actions/io', () => ({
}))
jest.mock('../src/execute', () => ({
// eslint-disable-next-line @typescript-eslint/naming-convention
__esModule: true,
execute: jest.fn()
}))

View File

@ -1,3 +1,4 @@
/* eslint-disable import/first */
// Initial env variable setup for tests.
process.env['INPUT_FOLDER'] = 'build'
process.env['GITHUB_SHA'] = '123'

View File

@ -9,7 +9,7 @@
"scripts": {
"build": "rimraf lib && tsc --declaration",
"test": "jest",
"lint": "eslint src/**/*.ts",
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
"format": "prettier --write './**/*.ts'"
},
"repository": {

7
tsconfig.lint.json Normal file
View File

@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "."
},
"exclude": ["node_modules"]
}