diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 5fa882bb..00000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -extends: -- airbnb -- prettier -rules: - camelcase: - - 'off' - import/no-extraneous-dependencies: - - 'off' - import/prefer-default-export: - - 'off' - import/no-unresolved: - - 'off' - jsx-a11y/anchor-is-valid: - - 'off' - no-undef: - - 'off' - react/destructuring-assignment: - - 'off' - react/forbid-prop-types: - - 'off' - react/jsx-filename-extension: - - 1 - - extensions: - - ".js" - - ".jsx" - react/jsx-one-expression-per-line: - - 'off' - react/no-array-index-key: - - 'off' - react/no-danger: - - 'off' - react/no-typos: - - 'off' -settings: - import/external-module-folders: [ 'assets', 'config', 'ui', 'lib'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0094fddb..c8cd8476 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2.3.1 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '22.x' - name: Install Project Dependencies run: yarn install diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 54f08bcc..40066fbb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2.3.1 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '22.x' - name: Install Project Dependencies run: yarn install diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..a916e664 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,46 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default [ + ...compat.extends("airbnb", "prettier"), + { + settings: { + "import/external-module-folders": ["assets", "config", "ui", "lib"], + }, + + rules: { + camelcase: ["off"], + "import/no-extraneous-dependencies": ["off"], + "import/prefer-default-export": ["off"], + "import/no-unresolved": ["off"], + "jsx-a11y/anchor-is-valid": ["off"], + "no-undef": ["off"], + "react/destructuring-assignment": ["off"], + "react/forbid-prop-types": ["off"], + + "react/jsx-filename-extension": [ + 1, + { + extensions: [".js", ".jsx"], + }, + ], + + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-spreading": ["off"], + "react/no-array-index-key": ["off"], + "react/no-danger": ["off"], + "react/no-typos": ["off"], + "react/require-default-props": ["off"], + }, + }, +]; diff --git a/gatsby-config.js b/gatsby-config.js index b6f98266..11c5f316 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -2,9 +2,10 @@ module.exports = { siteMetadata: {}, plugins: [ "gatsby-plugin-catch-links", + `gatsby-plugin-image`, "gatsby-plugin-react-helmet", + "gatsby-plugin-netlify", `gatsby-plugin-offline`, - `gatsby-plugin-netlify-cache`, `gatsby-plugin-sharp`, `gatsby-plugin-styled-components`, `gatsby-plugin-twitter`, diff --git a/lib/assets/fonts/index.js b/lib/assets/fonts/index.js index c962c85b..5362e619 100644 --- a/lib/assets/fonts/index.js +++ b/lib/assets/fonts/index.js @@ -1 +1 @@ -export { default as iconfont } from "./bif-iconfont/style.css"; +import "./bif-iconfont/style.css"; diff --git a/lib/ui/components/actions/Action.js b/lib/ui/components/actions/Action.js index 24c7c259..1d57fb11 100644 --- a/lib/ui/components/actions/Action.js +++ b/lib/ui/components/actions/Action.js @@ -1,5 +1,5 @@ import React from "react"; -import { bool, oneOfType, array, object, string } from "prop-types"; +import PropTypes from "prop-types"; import { withTheme } from "styled-components"; import Button from "./Button"; @@ -9,32 +9,23 @@ import withObfuscation from "./withObfuscation"; const ObfButton = withObfuscation(Button); const ObfLink = withObfuscation(Link); -const Action = props => { - const { obfuscated, button } = props; +function Action(props) { + const { obfuscated, button, ...restProps } = props; if (obfuscated) { if (button) { - return ; + return ; } - return ; + return ; } if (button) { - return