mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
refine eslint rule migration for app
This commit is contained in:
parent
1936e5f1db
commit
97a9bd7775
@ -68,7 +68,8 @@ export default tseslint.config(
|
|||||||
'semi': ['error', 'never'],
|
'semi': ['error', 'never'],
|
||||||
'quotes': ['error', 'single', { avoidEscape: true }],
|
'quotes': ['error', 'single', { avoidEscape: true }],
|
||||||
'comma-dangle': ['error', 'always-multiline'],
|
'comma-dangle': ['error', 'always-multiline'],
|
||||||
'space-before-function-paren': ['error', 'always'],
|
// Disabled: conflicts with common TypeScript/React patterns
|
||||||
|
// 'space-before-function-paren': ['error', 'always'],
|
||||||
'keyword-spacing': ['error', { before: true, after: true }],
|
'keyword-spacing': ['error', { before: true, after: true }],
|
||||||
'space-infix-ops': 'error',
|
'space-infix-ops': 'error',
|
||||||
'eol-last': ['error', 'always'],
|
'eol-last': ['error', 'always'],
|
||||||
@ -80,8 +81,15 @@ export default tseslint.config(
|
|||||||
// Disable indent rule due to known issues with TypeScript/JSX
|
// Disable indent rule due to known issues with TypeScript/JSX
|
||||||
// 'indent': ['error', 2],
|
// 'indent': ['error', 2],
|
||||||
'linebreak-style': ['error', 'unix'],
|
'linebreak-style': ['error', 'unix'],
|
||||||
|
|
||||||
|
// Additional standard rules that were missing
|
||||||
|
'eqeqeq': ['error', 'always', { null: 'ignore' }],
|
||||||
|
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
|
||||||
|
'array-callback-return': ['error', { allowImplicit: false, checkForEach: false }],
|
||||||
|
|
||||||
// React rules
|
// React rules
|
||||||
'react/react-in-jsx-scope': 'off',
|
'react/react-in-jsx-scope': 'off',
|
||||||
|
'react/no-unescaped-entities': 'error',
|
||||||
'react-hooks/rules-of-hooks': 'error',
|
'react-hooks/rules-of-hooks': 'error',
|
||||||
'react-hooks/exhaustive-deps': 'warn',
|
'react-hooks/exhaustive-deps': 'warn',
|
||||||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
||||||
@ -174,11 +182,16 @@ export default tseslint.config(
|
|||||||
// TypeScript configs (applied after main config)
|
// TypeScript configs (applied after main config)
|
||||||
...tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
...tseslint.configs.strict,
|
...tseslint.configs.strict,
|
||||||
|
...tseslint.configs.stylistic,
|
||||||
|
|
||||||
// TypeScript type-checking configuration
|
// TypeScript type-checking configuration
|
||||||
{
|
{
|
||||||
files: ['**/*.{ts,tsx}'],
|
files: ['**/*.{ts,tsx}'],
|
||||||
extends: [...tseslint.configs.recommendedTypeChecked],
|
extends: [
|
||||||
|
...tseslint.configs.recommendedTypeChecked,
|
||||||
|
...tseslint.configs.strictTypeChecked,
|
||||||
|
...tseslint.configs.stylisticTypeChecked,
|
||||||
|
],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: ['./tsconfig.json'],
|
project: ['./tsconfig.json'],
|
||||||
@ -190,6 +203,9 @@ export default tseslint.config(
|
|||||||
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
|
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
|
||||||
'no-void': ['error', { allowAsStatement: true }],
|
'no-void': ['error', { allowAsStatement: true }],
|
||||||
|
|
||||||
|
// Disable empty function rule - legitimate use in React contexts and empty constructors
|
||||||
|
'@typescript-eslint/no-empty-function': 'off',
|
||||||
|
|
||||||
// Configure no-unused-expressions to allow logical AND and ternary patterns
|
// Configure no-unused-expressions to allow logical AND and ternary patterns
|
||||||
'@typescript-eslint/no-unused-expressions': ['error', {
|
'@typescript-eslint/no-unused-expressions': ['error', {
|
||||||
allowShortCircuit: true,
|
allowShortCircuit: true,
|
||||||
|
|||||||
@ -21,6 +21,7 @@ export class layersApi {
|
|||||||
{ itemType: ['*.*', { profileTemplate: ['*', 'item.*.*.*.*'] }] },
|
{ itemType: ['*.*', { profileTemplate: ['*', 'item.*.*.*.*'] }] },
|
||||||
{ markerIcon: ['*'] } as any,
|
{ markerIcon: ['*'] } as any,
|
||||||
],
|
],
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
filter: { maps: { maps_id: { id: { _eq: this.mapId } } } },
|
filter: { maps: { maps_id: { id: { _eq: this.mapId } } } },
|
||||||
limit: 500,
|
limit: 500,
|
||||||
sort: ['sort'],
|
sort: ['sort'],
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/no-useless-constructor */
|
/* eslint-disable @typescript-eslint/no-useless-constructor */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import { readPermissions } from '@directus/sdk'
|
import { readPermissions } from '@directus/sdk'
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
// /* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
||||||
import { createUser, passwordRequest, passwordReset, readMe, updateMe } from '@directus/sdk'
|
import { createUser, passwordRequest, passwordReset, readMe, updateMe } from '@directus/sdk'
|
||||||
|
|
||||||
import { directusClient } from './directus'
|
import { directusClient } from './directus'
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable import/no-relative-parent-imports */
|
/* eslint-disable import/no-relative-parent-imports */
|
||||||
/* eslint-disable new-cap */
|
/* eslint-disable new-cap */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable camelcase */
|
||||||
import type { Item, Tag } from 'utopia-ui'
|
import type { Item, Tag } from 'utopia-ui'
|
||||||
|
|
||||||
export const tags: Tag[] = [
|
export const tags: Tag[] = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user