Feat/SW-3031 imagevault updates
* chore(SW-3031): Updated dependencies * feat(SW-3031): Added Imagevault Id to title and updated delete functionality Approved-by: Michael Zetterberg
This commit is contained in:
133
rte/eslint.config.mjs
Normal file
133
rte/eslint.config.mjs
Normal file
@@ -0,0 +1,133 @@
|
||||
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"
|
||||
import { FlatCompat } from "@eslint/eslintrc"
|
||||
import js from "@eslint/js"
|
||||
import typescriptEslint from "@typescript-eslint/eslint-plugin"
|
||||
import tsParser from "@typescript-eslint/parser"
|
||||
import _import from "eslint-plugin-import"
|
||||
import jsxA11Y from "eslint-plugin-jsx-a11y"
|
||||
import react from "eslint-plugin-react"
|
||||
import { defineConfig, globalIgnores } from "eslint/config"
|
||||
import globals from "globals"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
|
||||
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 defineConfig([
|
||||
globalIgnores(["node_modules/**/*"]),
|
||||
{
|
||||
extends: compat.extends("eslint:recommended"),
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.commonjs,
|
||||
},
|
||||
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx}"],
|
||||
|
||||
extends: fixupConfigRules(
|
||||
compat.extends(
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:jsx-a11y/recommended"
|
||||
)
|
||||
),
|
||||
|
||||
plugins: {
|
||||
react: fixupPluginRules(react),
|
||||
"jsx-a11y": fixupPluginRules(jsxA11Y),
|
||||
},
|
||||
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
|
||||
formComponents: ["Form"],
|
||||
|
||||
linkComponents: [
|
||||
{
|
||||
name: "Link",
|
||||
linkAttribute: "to",
|
||||
},
|
||||
{
|
||||
name: "NavLink",
|
||||
linkAttribute: "to",
|
||||
},
|
||||
],
|
||||
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
project: "./rte/tsconfig.json",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"react/jsx-uses-vars": "error",
|
||||
"react/jsx-uses-react": "error",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
|
||||
extends: fixupConfigRules(
|
||||
compat.extends(
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript"
|
||||
)
|
||||
),
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": fixupPluginRules(typescriptEslint),
|
||||
import: fixupPluginRules(_import),
|
||||
},
|
||||
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
},
|
||||
|
||||
settings: {
|
||||
"import/internal-regex": "^~/",
|
||||
|
||||
"import/resolver": {
|
||||
node: {
|
||||
extensions: [".ts", ".tsx"],
|
||||
},
|
||||
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["**/.eslintrc.cjs"],
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
Reference in New Issue
Block a user