Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion apps/perf-test-react-components/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"root": true,
"rules": {
"@griffel/styles-file": "off",
"no-console": "off"
"no-console": "off",
"no-restricted-globals": "off"
}
}
3 changes: 2 additions & 1 deletion apps/public-docsite-v9/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"no-restricted-globals": "off"
}
}
4 changes: 3 additions & 1 deletion apps/react-18-tests-v8/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": ["plugin:@fluentui/eslint-plugin/react"],
"root": true,
"rules": {}
"rules": {
"no-restricted-globals": "off"
}
}
4 changes: 3 additions & 1 deletion apps/react-18-tests-v9/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"extends": ["plugin:@fluentui/eslint-plugin/react"],
"root": true,
"rules": {}
"rules": {
"no-restricted-globals": "off"
}
}
3 changes: 2 additions & 1 deletion apps/recipes-react-components/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"no-restricted-globals": "off"
}
}
3 changes: 2 additions & 1 deletion apps/ssr-tests-v9/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": ["plugin:@fluentui/eslint-plugin/node"],
"root": true,
"rules": {
"import/no-extraneous-dependencies": ["error", { "packageDir": ["../../", "./"] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": ["../../", "./"] }],
"no-restricted-globals": "off"
}
}
3 changes: 2 additions & 1 deletion apps/stress-test/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": ["plugin:@fluentui/eslint-plugin/node"],
"root": true,
"rules": {
"import/no-extraneous-dependencies": ["error", { "packageDir": ["../../", "./"] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": ["../../", "./"] }],
"no-restricted-globals": "off"
}
}
3 changes: 2 additions & 1 deletion apps/vr-tests-react-components/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/jsx-no-bind": "off",
"deprecation/deprecation": "off",
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }]
"import/no-extraneous-dependencies": ["error", { "packageDir": [".", "../.."] }],
"no-restricted-globals": "off"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/cra-template",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access for @fluentui/react-components",
"packageName": "@fluentui/eslint-plugin",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/global-context",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/react-calendar-compat",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/react-motion-preview",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/react-shared-contexts",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/react-utilities",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: disallow `window` and `document` access",
"packageName": "@fluentui/react-window-provider",
"email": "seanmonahan@microsoft.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions packages/cra-template/template/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mergeStyles({
},
});

// eslint-disable-next-line no-restricted-globals
ReactDOM.render(<App />, document.getElementById('root'));

// If you want to start measuring performance in your app, pass a function
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-plugin/src/configs/react-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const configHelpers = require('../utils/configHelpers');
const { react: restrictedGlobals } = require('./restricted-globals');

/** @type {import("eslint").Linter.Config} */
module.exports = {
Expand Down Expand Up @@ -28,6 +29,7 @@ module.exports = {
'@griffel/hook-naming': 'error',
'@griffel/no-shorthands': 'error',
'@griffel/styles-file': 'error',
'no-restricted-globals': restrictedGlobals,
/**
* react eslint rules
* @see https://github.com/yannickcr/eslint-plugin-react
Expand Down Expand Up @@ -122,13 +124,15 @@ module.exports = {
files: [...configHelpers.testFiles],
rules: {
'react/jsx-no-bind': 'off',
'no-restricted-globals': 'off',
},
},
{
files: '**/*.stories.tsx',
rules: {
// allow makeStyles calls in stories as examples should be defined in a single file
'@griffel/styles-file': 'off',
'no-restricted-globals': 'off',
Comment thread
spmonahan marked this conversation as resolved.
// allow arrow functions in stories for now (may want to change this later since using
// constantly-mutating functions can be an anti-pattern which we may not want to demonstrate
// in our converged components docs; it happened to be allowed starting out because .stories
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/configs/react-legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
rules: {
'jsdoc/check-tag-names': 'off',
'@griffel/no-shorthands': 'off',
'no-restricted-globals': 'off',
},
overrides: [],
};
Loading