Skip to content

Commit

Permalink
Add new eslint rules (no-unnecessary-condition, no-unused-expressions…
Browse files Browse the repository at this point in the history
…, etc) and tsconfig noUncheckedIndexedAccess (#4513)
  • Loading branch information
cmdcolin authored Aug 12, 2024
1 parent ab4faed commit 615b1e3
Show file tree
Hide file tree
Showing 744 changed files with 5,726 additions and 5,316 deletions.
26 changes: 0 additions & 26 deletions .eslintignore

This file was deleted.

206 changes: 0 additions & 206 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion config/jest/babelTransform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-extraneous-dependencies
module.exports = require('babel-jest').default.createTransformer({
rootMode: 'upward',
})
3 changes: 1 addition & 2 deletions config/jest/console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const originalWarn = console.warn
const originalError = console.error

jest.spyOn(console, 'error').mockImplementation((...args) => {
Expand All @@ -14,5 +13,5 @@ jest.spyOn(console, 'error').mockImplementation((...args) => {
return undefined
}

return originalError.call(console, ...args)
originalError.call(console, ...args)
})
11 changes: 4 additions & 7 deletions config/jest/textEncoder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import util from 'util'
if (!global.TextEncoder) {
global.TextEncoder = util.TextEncoder
}
if (!global.TextDecoder) {
global.TextDecoder = util.TextDecoder
}
import { TextEncoder, TextDecoder } from 'util'

global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
2 changes: 1 addition & 1 deletion docs/generateConfigDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ${derives.code}
`
: ''
const slotstr = `${slots.length ? `### ${config.name} - Slots` : ''}\n${slots
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map(({ name, docs, code }: any) => {
return `#### slot: ${name}
Expand Down
8 changes: 4 additions & 4 deletions docs/generateStateModelDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function generateStateModelDocs(files: string[]) {
({ model, getters, properties, actions, methods, filename }) => {
if (model) {
const getterstr = `${getters.length ? `### ${model.name} - Getters` : ''}\n${getters
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map(({ name, docs, signature }: any) =>
join(
`#### getter: ${name}`,
Expand All @@ -123,7 +123,7 @@ function generateStateModelDocs(files: string[]) {
.join('\n')}`

const methodstr = `${methods.length ? `### ${model.name} - Methods` : ''}\n${methods
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map(({ name, docs, signature }: any) =>
join(
`#### method: ${name}`,
Expand All @@ -134,7 +134,7 @@ function generateStateModelDocs(files: string[]) {
.join('\n')}`

const propertiesstr = `${properties.length ? `### ${model.name} - Properties` : ''}\n${properties
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map(({ name, docs, code, signature }: any) =>
join(
`#### property: ${name}`,
Expand All @@ -145,7 +145,7 @@ function generateStateModelDocs(files: string[]) {
.join('\n')}`

const actionstr = `${actions.length ? `### ${model.name} - Actions` : ''}\n${actions
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map(({ name, docs, signature }: any) =>
join(
`#### action: ${name}`,
Expand Down
Loading

0 comments on commit 615b1e3

Please sign in to comment.