Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

50 changes: 0 additions & 50 deletions .eslintrc.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ jobs:
with:
submodules: recursive

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install
env:
GITHUB_NPM_TOKEN: ${{ secrets.LEON_GITHUB_NPM_PAT }}
Expand Down
84 changes: 84 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import pluginJs from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import pluginPrettier from "eslint-plugin-prettier";
import pluginReact from "eslint-plugin-react";
import pluginReactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import tseslint from "typescript-eslint";

/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: ["**/node_modules/", "**/public/", "**/assets/", "**/.cache/", "**/coverage/"],
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
plugins: {
react: pluginReact,
"react-hooks": pluginReactHooks,
prettier: pluginPrettier,
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
...pluginReact.configs.recommended.rules,
...pluginReactHooks.configs.recommended.rules,
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error",

// Disable new strict rules from react-hooks that break existing code
"react-hooks/set-state-in-effect": "off",
"react-hooks/refs": "off",

// Original overrides
"react/prop-types": "off",
"no-unused-vars": "off",
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
}
},
rules: {
"@typescript-eslint/no-unused-vars": ["warn", { "vars": "local", "args": "after-used" }],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-require-imports": "off", // frequent in gatsby config
},
},
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",
}
},
{
files: ["**/__mocks__/**"],
rules: {
"@typescript-eslint/no-unused-vars": "off",
}
},
eslintConfigPrettier,
];
4 changes: 0 additions & 4 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ require("ts-node").register();

// Use a TypeScript version of gatsby-config.js.
module.exports = require("./gatsby-config.ts");

flags: {
THE_FLAG: false;
}
28 changes: 13 additions & 15 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,22 @@ export const createPages: GatsbyNode["createPages"] = async ({ graphql, actions,
const docsTemplate = path.resolve(`src/components/layout/MdxLayout.tsx`);

// Variables can be added as the second function parameter
const result = await graphql<MdxGraphType>(
`
query {
allMdx(filter: { fileAbsolutePath: { regex: "//docs//" } }) {
nodes {
id
slug
excerpt
rawBody
headings {
value
depth
}
const result = await graphql<MdxGraphType>(`
query {
allMdx(filter: { fileAbsolutePath: { regex: "//docs//" } }) {
nodes {
id
slug
excerpt
rawBody
headings {
value
depth
}
}
}
`
);
}
`);

if (result.errors || !result.data) {
reporter.panicOnBuild('🚨 ERROR: Loading "createPages" query');
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,35 @@
"react-helmet": "^6.1.0",
"react-icons": "^4.2.0",
"sharp": "^0.32.6",
"typescript": "^4.2.3",
"typescript": "^5.9.3",
"webpack": "^5.104.1"
},
"devDependencies": {
"@eslint/js": "9.26.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.0.0",
"@types/jest": "^26.0.21",
"@types/js-yaml": "^4.0.4",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"babel-jest": "^26.6.3",
"babel-preset-gatsby": "^1.1.0",
"eslint": "^9.26.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-webpack-plugin": "^2.5.2",
"gatsby-plugin-eslint": "^3.0.0",
"gatsby-plugin-remove-trailing-slashes": "^3.7.1",
"globals": "^17.3.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-junit": "^12.0.0",
"js-yaml": "^4.1.1",
"prettier": "^2.2.1",
"prettier": "^3.8.1",
"ts-jest": "^26.5.3",
"ts-node": "^10.4.0"
"ts-node": "^10.4.0",
"typescript-eslint": "^8.55.0"
}
}
2 changes: 0 additions & 2 deletions src/mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

import { MDXProviderComponentsProp } from "@mdx-js/react";
import { Typography } from "@mui/material";
Expand Down
Loading