docs: update to next 15 + eslint 9 (#9839)
* update next * updated react * update eslint * finish updating eslint * fix content lint errors * fix docs test * fix vale action * fix installation errors
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
"docs/content"
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
import prettier from "eslint-plugin-prettier"
|
||||
import markdown from "eslint-plugin-markdown"
|
||||
import globals from "globals"
|
||||
import babelParser from "@babel/eslint-parser"
|
||||
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin"
|
||||
import tsParser from "@typescript-eslint/parser"
|
||||
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 [
|
||||
{
|
||||
ignores: [
|
||||
"**/references/**/*",
|
||||
"**/events-reference/**/*",
|
||||
"**/_events-table/**/*",
|
||||
],
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
prettier,
|
||||
markdown,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
|
||||
parser: babelParser,
|
||||
ecmaVersion: 13,
|
||||
sourceType: "module",
|
||||
|
||||
parserOptions: {
|
||||
requireConfigFile: false,
|
||||
|
||||
ecmaFeatures: {
|
||||
experimentalDecorators: true,
|
||||
modules: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"no-undef": "off",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-unused-labels": "off",
|
||||
"no-console": "off",
|
||||
curly: ["error", "all"],
|
||||
"new-cap": "off",
|
||||
"require-jsdoc": "off",
|
||||
camelcase: "off",
|
||||
"no-invalid-this": "off",
|
||||
|
||||
"max-len": [
|
||||
"warn",
|
||||
{
|
||||
code: 64,
|
||||
},
|
||||
],
|
||||
|
||||
semi: ["error", "never"],
|
||||
|
||||
quotes: [
|
||||
"error",
|
||||
"double",
|
||||
{
|
||||
allowTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
{
|
||||
arrays: "always-multiline",
|
||||
objects: "always-multiline",
|
||||
imports: "always-multiline",
|
||||
exports: "always-multiline",
|
||||
functions: "never",
|
||||
},
|
||||
],
|
||||
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"arrow-parens": ["error", "always"],
|
||||
"linebreak-style": 0,
|
||||
|
||||
"no-confusing-arrow": [
|
||||
"error",
|
||||
{
|
||||
allowParens: false,
|
||||
},
|
||||
],
|
||||
|
||||
"space-before-function-paren": [
|
||||
"error",
|
||||
{
|
||||
anonymous: "always",
|
||||
named: "never",
|
||||
asyncArrow: "always",
|
||||
},
|
||||
],
|
||||
|
||||
"space-infix-ops": "off",
|
||||
"eol-last": ["error", "always"],
|
||||
"react/prop-types": "off",
|
||||
"react/jsx-no-undef": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.md", "**/*.mdx"],
|
||||
processor: "markdown/markdown",
|
||||
},
|
||||
{
|
||||
files: ["**/*.md/*.js", "**/*.mdx/*.js", "**/*.md/*.jsx", "**/*.mdx/*.jsx"],
|
||||
},
|
||||
...compat.extends("plugin:@typescript-eslint/recommended").map((config) => ({
|
||||
...config,
|
||||
files: ["**/*.md/*.ts", "**/*.mdx/*.ts", "**/*.md/*.tsx", "**/*.mdx/*.tsx"],
|
||||
})),
|
||||
{
|
||||
files: ["**/*.md/*.ts", "**/*.mdx/*.ts", "**/*.md/*.tsx", "**/*.mdx/*.tsx"],
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslintEslintPlugin,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
},
|
||||
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
"docs/next"
|
||||
],
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: ".",
|
||||
},
|
||||
},
|
||||
ignorePatterns: [
|
||||
"generated"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
import prettier from "eslint-plugin-prettier/recommended"
|
||||
import globals from "globals"
|
||||
import babelParser from "@babel/eslint-parser"
|
||||
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin"
|
||||
import tsParser from "@typescript-eslint/parser"
|
||||
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 [
|
||||
prettier,
|
||||
{
|
||||
ignores: ["**/eslint-config-docs", "**/.eslintrc.js", "**/dist"],
|
||||
},
|
||||
...compat.extends(
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:@next/next/recommended"
|
||||
),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.jest,
|
||||
...globals.browser,
|
||||
},
|
||||
|
||||
parser: babelParser,
|
||||
ecmaVersion: 13,
|
||||
sourceType: "module",
|
||||
|
||||
parserOptions: {
|
||||
requireConfigFile: false,
|
||||
|
||||
ecmaFeatures: {
|
||||
experimentalDecorators: true,
|
||||
jsx: true,
|
||||
modules: true,
|
||||
},
|
||||
|
||||
project: true,
|
||||
},
|
||||
},
|
||||
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
curly: ["error", "all"],
|
||||
"new-cap": "off",
|
||||
"require-jsdoc": "off",
|
||||
"no-unused-expressions": "off",
|
||||
"no-unused-vars": "off",
|
||||
camelcase: "off",
|
||||
"no-invalid-this": "off",
|
||||
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
code: 80,
|
||||
ignoreStrings: true,
|
||||
ignoreRegExpLiterals: true,
|
||||
ignoreComments: true,
|
||||
ignoreTrailingComments: true,
|
||||
ignoreUrls: true,
|
||||
ignoreTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
|
||||
semi: ["error", "never"],
|
||||
|
||||
quotes: [
|
||||
"error",
|
||||
"double",
|
||||
{
|
||||
allowTemplateLiterals: true,
|
||||
},
|
||||
],
|
||||
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
{
|
||||
arrays: "always-multiline",
|
||||
objects: "always-multiline",
|
||||
imports: "always-multiline",
|
||||
exports: "always-multiline",
|
||||
functions: "never",
|
||||
},
|
||||
],
|
||||
|
||||
"object-curly-spacing": ["error", "always"],
|
||||
"arrow-parens": ["error", "always"],
|
||||
"linebreak-style": 0,
|
||||
|
||||
"no-confusing-arrow": [
|
||||
"error",
|
||||
{
|
||||
allowParens: false,
|
||||
},
|
||||
],
|
||||
|
||||
"space-before-function-paren": [
|
||||
"error",
|
||||
{
|
||||
anonymous: "always",
|
||||
named: "never",
|
||||
asyncArrow: "always",
|
||||
},
|
||||
],
|
||||
|
||||
"space-infix-ops": "error",
|
||||
"eol-last": ["error", "always"],
|
||||
|
||||
"no-console": [
|
||||
"error",
|
||||
{
|
||||
allow: ["error", "warn"],
|
||||
},
|
||||
],
|
||||
|
||||
"react/prop-types": [
|
||||
2,
|
||||
{
|
||||
ignore: ["className"],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
...compat
|
||||
.extends(
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:react/recommended"
|
||||
)
|
||||
.map((config) => ({
|
||||
...config,
|
||||
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
||||
})),
|
||||
{
|
||||
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslintEslintPlugin,
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 13,
|
||||
sourceType: "module",
|
||||
|
||||
parserOptions: {
|
||||
project: "./tsconfig.json",
|
||||
},
|
||||
},
|
||||
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: ".",
|
||||
},
|
||||
},
|
||||
ignores: [
|
||||
"**/next.config.js",
|
||||
"**/spec",
|
||||
"**/node_modules",
|
||||
"**/public",
|
||||
"**/.eslintrc.js",
|
||||
],
|
||||
|
||||
rules: {
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"@typescript-eslint/prefer-ts-expect-error": "off",
|
||||
"valid-jsdoc": "off",
|
||||
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"@typescript-eslint/promise-function-async": "error",
|
||||
"@/keyword-spacing": "error",
|
||||
|
||||
"@/space-before-function-paren": [
|
||||
"error",
|
||||
{
|
||||
anonymous: "always",
|
||||
named: "never",
|
||||
asyncArrow: "always",
|
||||
},
|
||||
],
|
||||
|
||||
"@/space-infix-ops": "error",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
},
|
||||
},
|
||||
]
|
||||
@@ -10,19 +10,19 @@
|
||||
"start": "next start",
|
||||
"start:monorepo": "yarn start -p 3004",
|
||||
"lint": "next lint --fix",
|
||||
"lint:content": "eslint --no-eslintrc -c .content.eslintrc.js app/**/*.mdx --fix",
|
||||
"lint:content": "eslint --no-config-lookup -c .content.eslintrc.mjs app/**/*.mdx --fix",
|
||||
"prep": "node ./scripts/prepare.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdx-js/loader": "^3.0.0",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"@mdx-js/loader": "^3.1.0",
|
||||
"@mdx-js/react": "^3.1.0",
|
||||
"@medusajs/icons": "^2.0.0",
|
||||
"@next/mdx": "^14.2.14",
|
||||
"@next/mdx": "15.0.1",
|
||||
"clsx": "^2.1.0",
|
||||
"docs-ui": "*",
|
||||
"next": "14.2.14",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"next": "15.0.1",
|
||||
"react": "rc",
|
||||
"react-dom": "rc",
|
||||
"rehype-mdx-code-props": "^2.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"remark-directive": "^3.0.0",
|
||||
@@ -30,15 +30,15 @@
|
||||
"remark-rehype-plugins": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdx": "^2.0.10",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18.2.0",
|
||||
"@types/react-dom": "^18.2.0",
|
||||
"@types/react": "npm:types-react@rc",
|
||||
"@types/react-dom": "npm:types-react@rc",
|
||||
"autoprefixer": "^10.0.1",
|
||||
"build-scripts": "*",
|
||||
"eslint": "^8",
|
||||
"eslint-config-docs": "*",
|
||||
"eslint-config-next": "14.2.3",
|
||||
"eslint": "^9.13.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"postcss": "^8",
|
||||
"tailwind": "*",
|
||||
"tailwindcss": "^3.3.0",
|
||||
@@ -48,5 +48,9 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"overrides": {
|
||||
"@types/react": "npm:types-react@rc",
|
||||
"@types/react-dom": "npm:types-react-dom@rc"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user