Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new eslint rules (no-unnecessary-condition, no-unused-expressions, etc) and tsconfig noUncheckedIndexedAccess #4513

Merged
merged 25 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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