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

feat(eslint-plugin): add triple-slash-reference rule to ban TS '///' within source code #30993

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "feat(eslint-plugin): add triple-slash-reference rule to ban TS '///' within source code",
"packageName": "@fluentui/eslint-plugin",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion packages/cra-template/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"files": ["template/**/*.{ts,tsx}"],
"rules": {
// the rule can't understand that the actual list of deps is in template.json
"import/no-extraneous-dependencies": "off"
"import/no-extraneous-dependencies": "off",
// valid in some template files - don't wanna spam consumer with inline eslint-disabled pragmas
"@typescript-eslint/triple-slash-reference": "off"
}
}
]
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/src/configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = {
*/
...getNamingConventionRule(),
'@fluentui/max-len': 'off',
// @typescript-eslint rules
'@typescript-eslint/triple-slash-reference': ['error', { lib: 'always', path: 'never', types: 'never' }],
},
overrides: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// <reference types="cypress" />
/// <reference types="cypress-real-events" />

import * as React from 'react';
import { mount as mountBase } from '@cypress/react';
import { FluentProvider } from '@fluentui/react-provider';
Expand Down
Loading