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

chore: fix web-components lint setup to avoid leaking rules to json parser scope #33852

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions apps/vr-tests-web-components/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
Copy link
Collaborator

@fabricteam fabricteam Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual regressions to review in the fluentui-web-components-v3 Visual Regression Report

Avatar 1 screenshots
Image Name Diff(in Pixels) Image Type
Avatar. - Dark Mode.normal.chromium_1.png 305 Changed
MenuList 1 screenshots
Image Name Diff(in Pixels) Image Type
MenuList. - Dark Mode.normal.chromium.png 396 Changed

"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
}
"overrides": [
{
"files": ["src/**/*.{ts,tsx}"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"@typescript-eslint/explicit-module-boundary-types": "off"
}
}
]
}
146 changes: 71 additions & 75 deletions packages/web-components/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:playwright/recommended"
],
"settings": {
"react": {
"version": "latest"
}
},
"rules": {
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-fallthrough": "off",
"no-unexpected-multiline": "off",
"no-useless-escape": "off",
"import/order": "error",
"sort-imports": [
"error",
{
"ignoreCase": true,
"ignoreDeclarationSort": true
}
],
"comma-dangle": "off",
"prefer-const": ["error", { "destructuring": "all" }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "property",
"format": null // disable for property names because of our foo__expanded convention for JSS
// TODO: I think we can come up with a regex that ignores variables with __ in them
},
{
"selector": "variable",
"format": null // disable for variable names because of our foo__expanded convention for JSS
// TODO: I think we can come up with a regex that ignores variables with __ in them
}
]
},
"overrides": [
{
"files": ["**/*.json"],
"files": ["**/*.{js,ts,tsx}"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:playwright/recommended"
],
"settings": {
"react": {
"version": "latest"
}
},
"rules": {
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-unused-expressions": "off"
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
"no-fallthrough": "off",
"no-unexpected-multiline": "off",
"no-useless-escape": "off",
"import/order": "error",
"sort-imports": [
"error",
{
"ignoreCase": true,
"ignoreDeclarationSort": true
}
],
"comma-dangle": "off",
"prefer-const": ["error", { "destructuring": "all" }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-unsafe-declaration-merging": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["UPPER_CASE", "camelCase", "PascalCase"],
"leadingUnderscore": "allow"
},
{
"selector": "property",
"format": null // disable for property names because of our foo__expanded convention for JSS
// TODO: I think we can come up with a regex that ignores variables with __ in them
},
{
"selector": "variable",
"format": null // disable for variable names because of our foo__expanded convention for JSS
// TODO: I think we can come up with a regex that ignores variables with __ in them
}
]
}
}
]
Loading
Oops, something went wrong.