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:
alex 2023-05-12 14:19:39 +01:00 committed by GitHub
parent a48a55d3de
commit 529574f83a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View file

@ -10,7 +10,6 @@
**/*.css.map
**/*.js.map
**/*.d.ts
**/*.test.ts
**/api/*
!**/pages/api/*
**/*.json

View file

@ -43,6 +43,7 @@ module.exports = {
{ fixMixedExportsWithInlineTypeSpecifier: true },
],
'local/no-export-star': 'error',
'no-only-tests/no-only-tests': 'error',
},
parser: '@typescript-eslint/parser',
parserOptions: {
@ -55,7 +56,6 @@ module.exports = {
rules: {
'@typescript-eslint/explicit-module-boundary-types': [0],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-only-tests/no-only-tests': ['error', { fix: true }],
},
},
{

View file

@ -31,6 +31,11 @@ export function generateSharedScripts(bublic: '<rootDir>' | '<rootDir>/bublic')
lint: {
execution: 'independent',
runsAfter: { 'build-types': {} },
cache: {
inputs: {
exclude: ['**/*.tsbuildinfo'],
},
},
},
'build-package': {
runsAfter: { 'build-api': {}, prebuild: {} },

View file

@ -332,8 +332,8 @@ describe('isFocused', () => {
})
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 blurMock = jest.spyOn(app.elm, 'blur').mockImplementation(() => {})
const focusMock = jest.spyOn(app.elm, 'focus').mockImplementation()
const blurMock = jest.spyOn(app.elm, 'blur').mockImplementation()
expect(focusMock).not.toHaveBeenCalled()
expect(blurMock).not.toHaveBeenCalled()