enable eslint for test files (#1363)
We've had a few issues where .only in tests wasn't getting caught by our lint rules. Turns out it's because we were excluding tests from eslint completely ### Change Type - [x] `internal` — Any other changes that don't affect the published package (will not publish a new version) ### Release Notes internal-only change
This commit is contained in:
parent
a48a55d3de
commit
529574f83a
4 changed files with 8 additions and 4 deletions
|
@ -10,7 +10,6 @@
|
||||||
**/*.css.map
|
**/*.css.map
|
||||||
**/*.js.map
|
**/*.js.map
|
||||||
**/*.d.ts
|
**/*.d.ts
|
||||||
**/*.test.ts
|
|
||||||
**/api/*
|
**/api/*
|
||||||
!**/pages/api/*
|
!**/pages/api/*
|
||||||
**/*.json
|
**/*.json
|
||||||
|
|
|
@ -43,6 +43,7 @@ module.exports = {
|
||||||
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
||||||
],
|
],
|
||||||
'local/no-export-star': 'error',
|
'local/no-export-star': 'error',
|
||||||
|
'no-only-tests/no-only-tests': 'error',
|
||||||
},
|
},
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
|
@ -55,7 +56,6 @@ module.exports = {
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/explicit-module-boundary-types': [0],
|
'@typescript-eslint/explicit-module-boundary-types': [0],
|
||||||
'no-console': ['error', { allow: ['warn', 'error'] }],
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
||||||
'no-only-tests/no-only-tests': ['error', { fix: true }],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,11 @@ export function generateSharedScripts(bublic: '<rootDir>' | '<rootDir>/bublic')
|
||||||
lint: {
|
lint: {
|
||||||
execution: 'independent',
|
execution: 'independent',
|
||||||
runsAfter: { 'build-types': {} },
|
runsAfter: { 'build-types': {} },
|
||||||
|
cache: {
|
||||||
|
inputs: {
|
||||||
|
exclude: ['**/*.tsbuildinfo'],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
'build-package': {
|
'build-package': {
|
||||||
runsAfter: { 'build-api': {}, prebuild: {} },
|
runsAfter: { 'build-api': {}, prebuild: {} },
|
||||||
|
|
|
@ -332,8 +332,8 @@ describe('isFocused', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls .focus() and .blur() on the container div when you call .focus() and .blur() on the editor', () => {
|
it('calls .focus() and .blur() on the container div when you call .focus() and .blur() on the editor', () => {
|
||||||
const focusMock = jest.spyOn(app.elm, 'focus').mockImplementation(() => {})
|
const focusMock = jest.spyOn(app.elm, 'focus').mockImplementation()
|
||||||
const blurMock = jest.spyOn(app.elm, 'blur').mockImplementation(() => {})
|
const blurMock = jest.spyOn(app.elm, 'blur').mockImplementation()
|
||||||
|
|
||||||
expect(focusMock).not.toHaveBeenCalled()
|
expect(focusMock).not.toHaveBeenCalled()
|
||||||
expect(blurMock).not.toHaveBeenCalled()
|
expect(blurMock).not.toHaveBeenCalled()
|
||||||
|
|
Loading…
Reference in a new issue