diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85a37fa887..26236ba304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: | pnpm install @@ -36,12 +36,30 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: | pnpm install pnpm typecheck + oxlint: + runs-on: ubuntu-24.04 + env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_REMOTE_ONLY: true + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4.0.0 + - name: Use Node.js + uses: actions/setup-node@v4.1.0 + with: + node-version: 22 + cache: "pnpm" + - run: | + pnpm install + pnpm build + pnpm oxlint -c .oxlintrc.json + lint: runs-on: ubuntu-24.04 env: @@ -53,7 +71,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: | pnpm install @@ -71,7 +89,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: | pnpm install @@ -85,7 +103,7 @@ jobs: needs: [typecheck, format] strategy: matrix: - node: ["20"] + node: ["22"] steps: - uses: actions/checkout@v4 with: @@ -115,7 +133,7 @@ jobs: # - name: Use Node.js # uses: actions/setup-node@v4.0.2 # with: - # node-version: 20 + # node-version: 22 # cache: 'pnpm' # - run: pnpm install # - run: pnpm run build @@ -124,7 +142,7 @@ jobs: build: strategy: matrix: - node: ["20"] + node: ["22"] runs-on: ubuntu-24.04 env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} @@ -152,7 +170,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: | pnpm install diff --git a/.github/workflows/fonts-upload.yml b/.github/workflows/fonts-upload.yml index 68bb0f2ce2..b6a8d6ab08 100644 --- a/.github/workflows/fonts-upload.yml +++ b/.github/workflows/fonts-upload.yml @@ -26,7 +26,7 @@ jobs: - uses: pnpm/action-setup@v4.0.0 - uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install diff --git a/.github/workflows/illustrations-update.yml b/.github/workflows/illustrations-update.yml index 75d670f394..273d4e95ed 100644 --- a/.github/workflows/illustrations-update.yml +++ b/.github/workflows/illustrations-update.yml @@ -28,7 +28,7 @@ jobs: - uses: pnpm/action-setup@v4.0.0 - uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install diff --git a/.github/workflows/illustrations-upload.yml b/.github/workflows/illustrations-upload.yml index f5b792fee9..bf999b3708 100644 --- a/.github/workflows/illustrations-upload.yml +++ b/.github/workflows/illustrations-upload.yml @@ -26,7 +26,7 @@ jobs: - uses: pnpm/action-setup@v4.0.0 - uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install diff --git a/.github/workflows/pull_request_title.yml b/.github/workflows/pull_request_title.yml index f6294552f7..88676982a3 100644 --- a/.github/workflows/pull_request_title.yml +++ b/.github/workflows/pull_request_title.yml @@ -12,7 +12,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install --prod - name: Check PR title diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6dbb236948..13e235598f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install - name: Create Release Pull Request or Publish to npm diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index 8e794cfdaf..d10fd5a238 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -6,7 +6,7 @@ jobs: size: strategy: matrix: - node: ["20"] + node: ["22"] runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sync-design-tokens.yml b/.github/workflows/sync-design-tokens.yml index 9890c4294b..76b0a907c5 100644 --- a/.github/workflows/sync-design-tokens.yml +++ b/.github/workflows/sync-design-tokens.yml @@ -16,7 +16,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: 20 + node-version: 22 cache: "pnpm" - run: pnpm install - name: Generate json files diff --git a/.gitignore b/.gitignore index e67a454539..e123c0b021 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ vitest.config.ts.* examples/*/.turbo packages/*/.turbo tools/*/.turbo + +# typescript +*.tsbuildinfo +.tsbuildinfo diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..7fffd833cf --- /dev/null +++ b/.npmrc @@ -0,0 +1,4 @@ +save-prefix="" +engine-strict=true +package-manager-strict-version=true +manage-package-manager-versions=true diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000000..7de5ff4b21 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,161 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "categories": { + "correctness": "error", + "style": "error", + "suspicious": "error", + "perf": "error", + "pedantic": "error", + "restriction": "error", + "nursery": "off" + }, + "plugins": [ + "import", + "node", + "react", + "react-perf", + "security", + "n", + "tree_shaking", + "typescript", + "unicorn", + "vitest" + ], + "overrides": [ + { + "files": ["**/__stories__/**/*.{ts,tsx}"], + "rules": { + "react/jsx-key": "off", + "no-console": "off", + "no-alert": "off" + } + } + ], + "rules": { + "@typescript-eslint/ban-tslint-comment": "off", + "@typescript-eslint/consistent-indexed-object-style": "off", + "@typescript-eslint/consistent-type-definitions": ["error", "type"], + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-magic-numbers": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript/no-explicit-any": "warn", + "@typescript-eslint/prefer-enum-initializers": "off", + "@typescript-eslint/prefer-function-type": "off", + "@typescript-eslint/prefer-literal-enum-member": "off", + "@typescript-eslint/prefer-ts-expect-error": "off", + "eslint/default-param-last": "off", + "eslint/max-lines": "off", + "eslint/max-params": "off", + "eslint/no-await-in-loop": "off", + "eslint/no-duplicate-imports": "off", + "eslint/no-empty-function": "off", + "eslint/no-magic-numbers": "off", + "eslint/no-ternary": "off", + "eslint/no-undef": "off", + "eslint/no-undefined": "off", + "eslint/sort-keys": "off", + "eslint/react-in-jsx-scope": "off", + "eslint/no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "eslint/require-await": "off", + "eslint/sort-imports": [ + "error", + { + "ignoreDeclarationSort": true, + "memberSyntaxSortOrder": ["single", "multiple", "all", "none"] + } + ], + "import/export": "off", + "import/import-no-namespace": "off", + "import/max-dependencies": "off", + "import/namespace": "off", + "import/no-default-export": "off", + "import/no-deprecated": "warn", + "import/no-duplicates": "off", + "import/no-unused-modules": "off", + "import/unambiguous": "warn", + "jest/no-conditional-expect": "off", + "jest/no-confusing-set-timeout": "off", + "jest/no-hooks": "off", + "jest/no-restricted-jest-methods": "off", + "jest/no-restricted-matchers": "off", + "jest/no-standalone-expect": "off", + "jest/no-untyped-mock-factory": "off", + "jest/prefer-called-with": "off", + "jest/prefer-comparison-matcher": "off", + "jest/prefer-equality-matcher": "off", + "jest/prefer-expect-resolves": "off", + "jest/prefer-lowercase-title": "off", + "jest/prefer-mock-promise-shorthand": "off", + "jest/prefer-spy-on": "off", + "jest/prefer-strict-equal": "off", + "jest/prefer-to-be": "off", + "jest/prefer-to-contain": "off", + "jest/prefer-to-have-length": "off", + "jest/prefer-todo": "error", + "jest/require-hook": "off", + "jest/require-to-throw-message": "off", + "oxc/no-accumulating-spread": "off", + "oxc/no-async-await": "off", + "oxc/no-barrel-file": "off", + "oxc/no-optional-chaining": "off", + "oxc/no-rest-spread-properties": "off", + "react-perf/jsx-no-jsx-as-prop": "off", + "react-perf/jsx-no-new-array-as-prop": "off", + "react-perf/jsx-no-new-function-as-prop": "off", + "react-perf/jsx-no-new-object-as-prop": "off", + "react/jsx-no-useless-fragment": "off", + "react/exhaustive-deps": "warn", + "react/iframe-missing-sandbox": "warn", + "react/jsx-no-target-blank": "off", + "react/no-set-state": "off", + "react/react-in-jsx-scope": "off", + "unicorn/error-message": "off", + "unicorn/filename-case": "off", + "unicorn/no-anonymous-default-export": "off", + "unicorn/no-array-for-each": "off", + "unicorn/no-array-reduce": "off", + "unicorn/no-await-expression-member": "off", + "unicorn/no-await-in-promise-methods": "off", + "unicorn/no-lonely-if": "off", + "unicorn/prefer-set-has": "off", + "unicorn/no-document-cookie": "off", + "unicorn/no-invalid-remove-event-listener": "off", + "unicorn/no-magic-array-flat-depth": "off", + "unicorn/no-negated-condition": "off", + "unicorn/no-new-array": "off", + "unicorn/no-null": "off", + "unicorn/no-object-as-default-parameter": "off", + "unicorn/no-process-exit": "off", + "unicorn/no-single-promise-in-promise-methods": "off", + "unicorn/no-useless-promise-resolve-reject": "off", + "unicorn/no-useless-undefined": "off", + "unicorn/no-zero-fractions": "off", + "unicorn/number-literal-case": "off", + "unicorn/numeric-separators-style": "off", + "unicorn/prefer-add-event-listener": "off", + "unicorn/prefer-array-some": "off", + "unicorn/prefer-blob-reading-methods": "off", + "unicorn/prefer-code-point": "off", + "unicorn/prefer-dom-node-append": "off", + "unicorn/prefer-dom-node-remove": "off", + "unicorn/prefer-logical-operator-over-ternary": "off", + "unicorn/prefer-node-protocol": "off", + "unicorn/prefer-query-selector": "off", + "unicorn/prefer-string-replace-all": "off", + "unicorn/prefer-string-slice": "off" + }, + "settings": { + "jsx-a11y": { + "components": { + "polymorphicPropName": "as" + } + }, + "react": {} + } +} diff --git a/eslint.config.mjs b/eslint.config.mjs index 216e3cd4e3..913f25dc8d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,6 +4,7 @@ import { FlatCompat } from '@eslint/eslintrc' import scwEmotion from '@scaleway/eslint-config-react/emotion' import scwJavascript from '@scaleway/eslint-config-react/javascript' import scwTypescript from '@scaleway/eslint-config-react/typescript' +import oxlint from 'eslint-plugin-oxlint' import globals from 'globals' import path from 'node:path' import { fileURLToPath } from 'node:url' @@ -148,4 +149,5 @@ export default [ 'react/jsx-props-no-spreading': 'off', }, }, + oxlint.configs['flat/all'], ] diff --git a/examples/next-advanced/next.config.js b/examples/next-advanced/next.config.js index dbb306a4d5..a1cd5604ee 100644 --- a/examples/next-advanced/next.config.js +++ b/examples/next-advanced/next.config.js @@ -30,4 +30,4 @@ const nextConfig = () => { return config } -module.exports = nextConfig() +export default nextConfig() diff --git a/examples/next-advanced/src/pages/_document.tsx b/examples/next-advanced/src/pages/_document.tsx index ae15ef666c..9d110914c9 100644 --- a/examples/next-advanced/src/pages/_document.tsx +++ b/examples/next-advanced/src/pages/_document.tsx @@ -7,7 +7,7 @@ class MyDocument extends Document { return (
- + { return config } -module.exports = nextConfig() +export default nextConfig() diff --git a/examples/next-login/src/pages/_app.tsx b/examples/next-login/src/pages/_app.tsx index ed6cc75180..c0244b2538 100644 --- a/examples/next-login/src/pages/_app.tsx +++ b/examples/next-login/src/pages/_app.tsx @@ -1,6 +1,6 @@ -import { ThemeProvider, Global, css } from '@emotion/react' +import { Global, ThemeProvider, css } from '@emotion/react' import { Button } from '@ultraviolet/ui' -import { darkTheme, theme, normalize } from '@ultraviolet/ui' +import { darkTheme, normalize, theme } from '@ultraviolet/ui' import type { AppProps } from 'next/app' import { useState } from 'react' diff --git a/examples/next-login/src/pages/_document.tsx b/examples/next-login/src/pages/_document.tsx index ae15ef666c..9d110914c9 100644 --- a/examples/next-login/src/pages/_document.tsx +++ b/examples/next-login/src/pages/_document.tsx @@ -7,7 +7,7 @@ class MyDocument extends Document { return ( - + { let tabLoaded = undefined switch (props.tab) { - case 'login': + case 'login': { tabLoaded =