Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected top-level property "overrides[0].extends" #118

Open
JuliaUsanova opened this issue Jul 2, 2021 · 0 comments
Open

Unexpected top-level property "overrides[0].extends" #118

JuliaUsanova opened this issue Jul 2, 2021 · 0 comments

Comments

@JuliaUsanova
Copy link

JuliaUsanova commented Jul 2, 2021

Hi! I have a bug "Unexpected top-level property overrides[1].extends." reproduced in eslint@7.29.0.

Project framework: angular 11,
eslint: 7.29.0

npm ls eslint
most_new@0.0.0 /Users/Julia_Usanova/WebstormProjects/most-new
└── eslint@7.29.0 

"devDependencies": {
		"@angular-devkit/build-angular": "0.1102.2",
		"@angular-devkit/build-ng-packagr": "0.1002.0",
		"@angular-eslint/builder": "1.2.0",
		"@angular-eslint/eslint-plugin": "1.2.0",
		"@angular-eslint/eslint-plugin-template": "1.2.0",
		"@angular-eslint/schematics": "1.2.0",
		"@angular-eslint/template-parser": "1.2.0",
		"@angular/cli": "11.1.4",
		"@angular/compiler-cli": "11.1.2",
		"@angular/language-service": "11.1.2",
		"@particle/lint": "1.1.4",
		"@types/chart.js": "^2.9.16",
		"@types/jasmine": "^3.7.7",
		"@types/lodash": "^4.14.170",
		"@types/moment": "^2.13.0",
		"@types/node": "12.11.7",
		"@types/request": "^2.48.5",
		"@typescript-eslint/eslint-plugin": "^4.28.0",
		"@typescript-eslint/parser": "^4.28.0",
		"eslint": "^7.29.0",
		"eslint-config-prettier": "8.1.0",
		"eslint-plugin-import": "2.22.1",
		"eslint-plugin-jsdoc": "30.7.6",
		"eslint-plugin-prefer-arrow": "1.2.2",
		"eslint-plugin-prettier": "3.3.1",
		"husky": "6.0.0",
		"karma": "^6.3.4",
		"karma-chrome-launcher": "~3.1.0",
		"karma-coverage": "^2.0.3",
		"karma-jasmine": "~4.0.1",
		"karma-spec-reporter": "~0.0.32",
		"lint-staged": "~10.5.4",
		"loader-utils": "^2.0.0",
		"prettier": "~2.2.1",
		"protractor": "5.4.4",
		"ts-node": "7.0.1",
		"typescript": "4.1.5",
		"webpack-bundle-analyzer": "^4.4.2",
		"webpack-cli": "^4.7.2"
	}

The project eslint.json file:

{
	"root": true,
	"env": {
		"node": true,
		"browser": true
	},
	"overrides": [
		{
			"files": ["*.ts"],
			"parserOptions": {
				"project": ["tsconfig.json", "e2e/tsconfig.json"],
				"createDefaultProgram": true
			},
			"extends": [
				"eslint:recommended",
				"plugin:@angular-eslint/recommended",
				"plugin:@typescript-eslint/recommended",
				"plugin:@typescript-eslint/recommended-requiring-type-checking",
				"plugin:@angular-eslint/template/process-inline-templates",
				"prettier"
			],
			"plugins": ["eslint-plugin-import"],
			"rules": {
				"@angular-eslint/component-selector": [
					"error",
					{
						"type": "element",
						"prefix": ["app"],
						"style": "kebab-case"
					}
				],
				"@angular-eslint/directive-selector": [
					"error",
					{
						"type": "attribute",
						"prefix": "app",
						"style": "camelCase"
					}
				],
				"no-shadow": "off",
				"indent": [
					"error",
					"tab",
					{
						"SwitchCase": 1
					}
				],
				"no-underscore-dangle": [
					"error",
					{
						"allow": ["__ACS__", "__byUrl", "_sendProcessEventMessage", "_chart"],
						"allowAfterThis": true,
						"allowFunctionParams": true
					}
				],
				"@typescript-eslint/no-unsafe-return": "warn",
				"@typescript-eslint/no-unsafe-assignment": "warn",
				"@typescript-eslint/no-unsafe-call": "warn",
				"@typescript-eslint/no-empty-function": "warn",
				"@typescript-eslint/no-unsafe-member-access": "error",
				"@typescript-eslint/no-floating-promises": "warn",
				"@typescript-eslint/unbound-method": "warn",
				"@typescript-eslint/restrict-template-expressions": "error",
				"@typescript-eslint/restrict-plus-operands": "error",
				"@typescript-eslint/ban-ts-comment": "off",

				"@typescript-eslint/no-unused-expressions": [
					"error",
					{
						"allowTernary": true,
						"allowShortCircuit": true
					}
				],
				"@typescript-eslint/consistent-type-definitions": "error",
				"@typescript-eslint/explicit-member-accessibility": [
					"off",
					{
						"accessibility": "explicit"
					}
				],
				"@typescript-eslint/member-delimiter-style": [
					"off",
					{
						"multiline": {
							"delimiter": "none",
							"requireLast": true
						},
						"singleline": {
							"delimiter": "semi",
							"requireLast": false
						}
					}
				],
				"@typescript-eslint/no-non-null-assertion": "off",
				"@typescript-eslint/prefer-for-of": "off",
				"@typescript-eslint/semi": ["off", null],
				"@typescript-eslint/naming-convention": [
					"error",
					{
						"selector": "enumMember",
						"format": ["PascalCase"]
					}
				],
				"@typescript-eslint/type-annotation-spacing": "off",
				"@typescript-eslint/no-shadow": [
					"error",
					{
						"ignoreTypeValueShadow": true
					}
				],
				"arrow-parens": ["off", "always"],
				"brace-style": ["off", "off"],
				"curly": "off",
				"eol-last": "off",
				"guard-for-in": "off",
				"import/order": "error",
				"linebreak-style": "off",
				"max-classes-per-file": "off",
				"max-len": [
					"warn",
					{
						"code": 120,
						"tabWidth": 4,
						"ignoreComments": true,
						"ignoreTrailingComments": true,
						"ignoreStrings": true
					}
				],
				"comma-dangle": ["error", "never"],
				"quotes": ["error", "single"],
				"new-parens": "off",
				"newline-per-chained-call": "off",
				"no-extra-semi": "error",
				"no-irregular-whitespace": "off",
				"no-trailing-spaces": [
					"error",
					{
						"ignoreComments": true
					}
				],
				"object-shorthand": ["error", "always"],
				"padding-line-between-statements": [
					"off",
					{
						"blankLine": "always",
						"prev": "*",
						"next": "return"
					}
				],
				"prefer-arrow/prefer-arrow-functions": "off",
				"quote-props": "off",
				"space-before-function-paren": "off",
				"space-in-parens": ["off", "never"]
			}
		},
		{
			"files": ["*.html"],
			"extends": ["plugin:@angular-eslint/template/recommended"],
			"rules": {}
		},
		{
			"files": ["*.js"],
			"extends": ["eslint:recommended", "prettier"],
			"plugins": [],
			"rules": {
				"no-unused-vars": "warn",
				"no-redeclare": "warn",
				"space-before-function-paren": [
					"error",
					{
						"anonymous": "never",
						"named": "never",
						"asyncArrow": "always"
					}
				],
				"space-in-parens": ["off", "never"]
			},
			"parserOptions": {
				"sourceType": "module",
				"ecmaVersion": 6
			}
		},
		{
			"files": ["*.html"],
			"excludedFiles": ["*inline-template-*.component.html"],
			"extends": ["prettier"],
			"plugins": ["prettier"],
			"rules": {
				"prettier/prettier": [
					"error",
					{
						"parser": "angular"
					}
				]
			}
		}
	]
}

The error in terminal when running eslint .:

ESLint configuration in /Users/Julia_Usanova/WebstormProjects/most-new/.eslintrc.json is invalid:
        - Unexpected top-level property "overrides[1].extends".

Error: ESLint configuration in /Users/Julia_Usanova/WebstormProjects/most-new/.eslintrc.json is invalid:
        - Unexpected top-level property "overrides[1].extends".

What I've tried to do to find the issue roots:

  1. comment out the "extends" property in every overrides element. - The error disappears then.
  2. set an empty string / empty array as a value in "extends" property. - The error appears
  3. remove several plugins, leave only "eslint:recommended" value in "extends" property. - The error appears.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant