Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
.
Repro Code
Thecodedidn't matter, and it wouldn'tworkwithanything.
ESLint Config
importnxfrom"@nx/eslint-plugin";importeslintConfigPrettierfrom"eslint-config-prettier/flat";importimportPluginfrom"eslint-plugin-import";importjsdocfrom"eslint-plugin-jsdoc";importjsxA11yfrom"eslint-plugin-jsx-a11y";importpluginLinguifrom"eslint-plugin-lingui";importplaywrightfrom"eslint-plugin-playwright";importreactfrom"eslint-plugin-react";importreactCompilerfrom"eslint-plugin-react-compiler";importreactHooksfrom"eslint-plugin-react-hooks";importreactRefreshfrom"eslint-plugin-react-refresh";importglobalsfrom"globals";importtseslintfrom"typescript-eslint";functioncreateEsLintConfig(reactBase=false){returntseslint.config(nx.configs["flat/base"],nx.configs["flat/javascript"],// Already extends // js.configs.recommended,nx.configs["flat/typescript"],// Almost same rules as ["flat/javascript"] but for ts filesjsdoc.configs["flat/recommended"],tseslint.configs.strictTypeChecked,tseslint.configs.stylisticTypeChecked,// nx.configs["flat/react"],reactBase&&react.configs.flat.all,reactBase&&react.configs.flat["jsx-runtime"],// Add this if you are using React 17+reactBase&&reactHooks.configs["recommended-latest"],reactBase&&reactRefresh.configs.recommended,reactBase&&jsxA11y.flatConfigs.recommended,reactBase&&pluginLingui.configs["flat/recommended"],reactBase&&reactCompiler.configs.recommended,// Todo: check if ignores is in the right place{ignores:["**/dist","**/vite.config.*.timestamp*","**/vitest.config.*.timestamp*",],},// NX targeted config{files:["**/*.ts","**/*.tsx","**/*.js","**/*.jsx"],rules:{"@nx/enforce-module-boundaries":["error",{allowCircularSelfDependency:true,enforceBuildableLibDependency:true,allow:["^.*/eslint(\\.base)?\\.config\\.[cm]?js$","^.*/vite(\\.base)?\\.config*",],depConstraints:[{sourceTag:"*",onlyDependOnLibsWithTags:["*"],},],},],},},// Playwright{ ...playwright.configs["flat/recommended"],files:["tests/**"],rules:{ ...playwright.configs["flat/recommended"].rules,// Customize Playwright rules// ...},},// Additional config{files:["**/*.ts","**/*.tsx","**/*.cts","**/*.mts","**/*.js","**/*.jsx","**/*.cjs","**/*.mjs",],// Override or add rules herelanguageOptions:{ecmaVersion:2020,globals:{ ...globals.serviceworker, ...globals.browser,},parserOptions:{ecmaVersion:"latest",ecmaFeatures:{jsx:true},sourceType:"module",// Linting with Type Information: StartprojectService:{parser:tseslint.parser,allowDefaultProject:["eslint.base.config.mjs","eslint.config.mjs","prettier.config.mjs",],},tsconfigRootDir:import.meta.dirname,// Linting with Type Information: End},},// eslint-disable-next-line @typescript-eslint/no-unsafe-assignmentplugins:{// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access ...importPlugin.flatConfigs.recommended.plugins,},rules:(function(){constbaseRules={"@typescript-eslint/array-type":"off","@typescript-eslint/consistent-type-definitions":"off","@typescript-eslint/consistent-type-imports":["warn",{prefer:"type-imports",fixStyle:"inline-type-imports",},],"no-unused-vars":"off","@typescript-eslint/no-unused-vars":["error",{varsIgnorePattern:"^[A-Z_]"},],"no-redeclare":"off","@typescript-eslint/no-redeclare":"error","@typescript-eslint/require-await":"off","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:{attributes:false,},},],"jsdoc/require-jsdoc":"off","jsdoc/tag-lines":["error","any",{startLines:1}],};if(reactBase){constreactRules={// Safely merge React-specific rule configs ...Object.fromEntries(nx.configs["flat/react"].map((config)=>Object.entries(config.rules??{})).flat(),), ...reactRefresh.configs.recommended.rules, ...reactCompiler.configs.recommended.rules, ...baseRules,"react-refresh/only-export-components":["warn",{allowConstantExport:true},],"react/jsx-filename-extension":[1,{extensions:[".tsx"]}],"react/jsx-no-bind":"off","react/jsx-max-depth":[2,{max:4}],// TODO: check this and"react/forbid-component-props":"off","react/jsx-no-literals":["warn",{noStrings:false,ignoreProps:true,allowedStrings:[],noAttributeStrings:false,elementOverrides:{Trans:{allowElement:true,// applyToNestedElements: true},},},],};returnreactRules;}returnbaseRules;})(),},// Prettier must come lasteslintConfigPrettier,);}exportdefaultcreateEsLintConfig(false);
tsconfig
{"compileOnSave":false,"compilerOptions": {"target":"ES2022","jsx":"react-jsx","module":"ESNext","lib": ["ES2022","DOM","DOM.Iterable"],"types": ["vite/client","vitest"],/* Bundler mode*/// "moduleResolution": "bundler",// "allowImportingTsExtensions": true,// "verbatimModuleSyntax": true,// "isolatedModules": true,// "moduleDetection": "force",// "noEmit": true,/* Linting*/"skipLibCheck":true,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noFallthroughCasesInSwitch":true,"noUncheckedSideEffectImports":true,"baseUrl":".","paths": {// "~/*": ["./*"],"~/classes/*": ["libs/classes/src/*"],"~/components/*": ["libs/components/src/*"],"~/contexts/*": ["libs/contexts/src/*"],"~/hooks/*": ["libs/hooks/src/*"],"~/models/*": ["libs/models/src/*"],"~/services/*": ["libs/services/src/*"],"~/types/*": ["libs/types/src/*"],"~/ui/*": ["libs/ui/src/*"],"~/utils/*": ["libs/utils/src/*"],"~/validations/*": ["libs/validations/src/*"] },/* Other base config*/"rootDir":".","sourceMap":true,"declaration":false,"moduleResolution":"node","emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"skipDefaultLibCheck":true },"exclude": ["node_modules","tmp"]}
Expected Result
It happened after upgrading, and I fixed it by downgrading to^8.29.0
with the same config, and it worked.
Actual Result
- eslint.config.mjs: Config (unnamed): Unexpected non-object config at user-defined index 24.
Additional Info
No response