Skip to content

Commit

Permalink
ci(root): remove dts files for eslint wd-270 (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
what1s1ove authored Oct 7, 2024
1 parent 53f343d commit 3b77099
Show file tree
Hide file tree
Showing 14 changed files with 626 additions and 713 deletions.
14 changes: 7 additions & 7 deletions apps/careers-whatislove-dev/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import wc from 'eslint-plugin-wc'

import baseConfig from '../../eslint.config.js'

/** @typedef {import('eslint').Linter.FlatConfig} */
let FlatConfig
/** @typedef {import('eslint').Linter.Config} */
let Config
/** @typedef {import('eslint').Linter.RulesRecord} */
let RulesRecord

/** @type {FlatConfig} */
/** @type {Config} */
let ignoresConfig = {
ignores: [`build`],
}

/** @type {FlatConfig} */
/** @type {Config} */
let litConfig = {
plugins: {
lit,
Expand All @@ -29,7 +29,7 @@ let litA11yConfig = {
rules: litA11y.configs.recommended.rules,
}

/** @type {FlatConfig} */
/** @type {Config} */
let wcConfig = {
plugins: {
wc,
Expand All @@ -40,7 +40,7 @@ let wcConfig = {
},
}

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let overridesConfigs = [
{
files: [`vite.config.js`],
Expand All @@ -50,7 +50,7 @@ let overridesConfigs = [
},
]

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let config = [
ignoresConfig,
...baseConfig,
Expand Down
2 changes: 1 addition & 1 deletion apps/careers-whatislove-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@types/fluent-ffmpeg": "2.1.24",
"eslint-plugin-lit": "1.14.0",
"eslint-plugin-lit-a11y": "4.1.2",
"eslint-plugin-wc": "2.1.0",
"eslint-plugin-wc": "2.2.0",
"fluent-ffmpeg": "2.1.2",
"vite-plugin-babel": "1.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/careers-whatislove-dev/packages.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
declare module 'eslint-plugin-lit-a11y' {
import { type Linter } from 'eslint'

const configs: Record<'recommended', Required<Linter.FlatConfig>>
const configs: Record<'recommended', Required<Linter.Config>>

export default {
configs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ class ScreenProcess extends LitElement {
/** @type {() => void} */
#handleTimeUpdate

/** @type {boolean} */
@property()
accessor #isPlaying = true

/** @type {ReturnType<typeof setTimeout> | undefined} */
@property()
accessor #phraseTimeoutId = undefined

/** @type {NodeReference<HTMLProgressElement>} */
#progressNodeRef = createRef()

Expand All @@ -54,9 +62,13 @@ class ScreenProcess extends LitElement {

/** @returns {void} */
#clickFullscreenHandler() {
document.fullscreenElement
? void document.exitFullscreen()
: void document.documentElement.requestFullscreen()
let hasFullScreenElement = Boolean(document.fullscreenElement)

if (hasFullScreenElement) {
void document.exitFullscreen()
} else {
void document.documentElement.requestFullscreen()
}
}

/** @returns {void} */
Expand Down Expand Up @@ -216,14 +228,6 @@ class ScreenProcess extends LitElement {
: nothing}
`
}

/** @type {boolean} */
@property()
accessor #isPlaying = true

/** @type {ReturnType<typeof setTimeout> | undefined} */
@property()
accessor #phraseTimeoutId = undefined
}

defineCustomElement(`cwd-screen-process`, ScreenProcess)
8 changes: 4 additions & 4 deletions apps/careers-whatislove-dev/src/pages/root/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class Root extends LitElement {
/** @type {(scene: ValuesOf<typeof Scene>) => ReturnType<html>} */
#handleSceneRender

/** @type {ValuesOf<typeof Scene>} */
@property()
accessor #scene = Scene.INITIAL

constructor() {
super()

Expand Down Expand Up @@ -75,10 +79,6 @@ class Root extends LitElement {
${this.#handleSceneRender(this.#scene)}
`
}

/** @type {ValuesOf<typeof Scene>} */
@property()
accessor #scene = Scene.INITIAL
}

defineCustomElement(`cwd-root`, Root)
20 changes: 12 additions & 8 deletions apps/certifications-whatislove-dev/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ import react from 'eslint-plugin-react'

import baseConfig from '../../eslint.config.js'

/** @typedef {import('eslint').Linter.FlatConfig} */
let FlatConfig
/** @typedef {import('eslint').Linter.Config} */
let Config
/** @typedef {import('eslint').ESLint.Plugin} */
let Plugin
/** @typedef {import('eslint').Linter.RulesRecord} */
let RulesRecord

/** @type {FlatConfig} */
/** @type {Config} */
let ignoresConfig = {
ignores: [`build`],
}

/** @type {FlatConfig} */
/** @type {Config} */
let reactConfig = {
files: [`**/*.jsx`],
plugins: {
react,
react: /** @type {Plugin} */ (react),
},
rules: react.configs[`jsx-runtime`].rules,
rules: /** @type {RulesRecord} */ (react.configs.flat[`jsx-runtime`].rules),
}

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let overridesConfigs = [
{
files: [`vite.config.js`],
Expand All @@ -29,7 +33,7 @@ let overridesConfigs = [
},
]

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let config = [ignoresConfig, ...baseConfig, reactConfig, ...overridesConfigs]

export default config
2 changes: 1 addition & 1 deletion apps/certifications-whatislove-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/react": "18.2.47",
"@types/react-dom": "18.2.18",
"@vitejs/plugin-react": "4.2.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react": "7.37.1",
"typed-css-modules": "0.9.1"
}
}
9 changes: 0 additions & 9 deletions apps/certifications-whatislove-dev/packages.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/certifications-whatislove-dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"exclude": ["build"],
"include": ["**/*.js", "**/*.jsx", "packages.d.ts", "vite-env.d.ts"],
"include": ["**/*.js", "**/*.jsx", "vite-env.d.ts"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
Expand Down
10 changes: 5 additions & 5 deletions apps/whatislove-dev/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import baseConfig from '../../eslint.config.js'

/** @typedef {import('eslint').Linter.FlatConfig} */
let FlatConfig
/** @typedef {import('eslint').Linter.Config} */
let Config

/** @type {FlatConfig} */
/** @type {Config} */
let ignoresConfig = {
ignores: [`build`],
}

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let overridesConfigs = [
{
files: [`src/data/**/*.js`, `eleventy.config.js`, `linthtml.config.js`],
Expand All @@ -32,7 +32,7 @@ let overridesConfigs = [
},
]

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let config = [ignoresConfig, ...baseConfig, ...overridesConfigs]

export default config
24 changes: 12 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import sonarjs from 'eslint-plugin-sonarjs'
import unicorn from 'eslint-plugin-unicorn'
import globals from 'globals'

/** @typedef {import('eslint').Linter.FlatConfig} */
let FlatConfig
/** @typedef {import('eslint').Linter.Config} */
let Config
/** @typedef {import('eslint').ESLint.Plugin} */
let Plugin
/** @typedef {import('eslint').Linter.RulesRecord} */
let RulesRecord

/** @type {FlatConfig} */
/** @type {Config} */
let ignoresConfig = {
ignores: [`apps`, `packages`],
}

/** @type {FlatConfig} */
/** @type {Config} */
let jsConfig = {
languageOptions: {
globals: globals.browser,
Expand Down Expand Up @@ -95,7 +95,7 @@ let jsConfig = {
},
}

/** @type {FlatConfig} */
/** @type {Config} */
let importConfig = {
plugins: {
import: importPlugin,
Expand All @@ -120,15 +120,15 @@ let importConfig = {
},
}

/** @type {FlatConfig} */
/** @type {Config} */
let sonarConfig = {
plugins: {
sonarjs: /** @type {Plugin} */ (/** @type {unknown} */ (sonarjs)),
},
rules: /** @type {RulesRecord} */ (sonarjs.configs.recommended.rules),
}

/** @type {FlatConfig} */
/** @type {Config} */
let unicornConfig = {
plugins: {
unicorn,
Expand All @@ -144,7 +144,7 @@ let unicornConfig = {
},
}

/** @type {FlatConfig} */
/** @type {Config} */
let perfectionistConfig = {
plugins: {
perfectionist: /** @type {Plugin} */ (
Expand All @@ -156,7 +156,7 @@ let perfectionistConfig = {
),
}

/** @type {FlatConfig} */
/** @type {Config} */
let jsdocConfig = {
plugins: {
jsdoc,
Expand Down Expand Up @@ -186,7 +186,7 @@ let jsdocConfig = {
},
}

/** @type {FlatConfig} */
/** @type {Config} */
let typescriptPlugin = {
languageOptions: {
parser: tsParser,
Expand Down Expand Up @@ -218,7 +218,7 @@ let typescriptPlugin = {
},
}

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let overridesConfigs = [
{
files: [
Expand All @@ -235,7 +235,7 @@ let overridesConfigs = [
},
]

/** @type {FlatConfig[]} */
/** @type {Config[]} */
let config = [
ignoresConfig,
jsConfig,
Expand Down
Loading

0 comments on commit 3b77099

Please sign in to comment.