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

eslint config: Fix modern module resolution #9562

Merged
merged 6 commits into from
Mar 25, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 0 additions & 36 deletions common/build/eslint-config-fluid/eslint7.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
Expand All @@ -34,8 +33,6 @@ module.exports = {
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"react",
"unicorn",
],
"reportUnusedDisableDirectives": true,
Expand All @@ -48,39 +45,6 @@ module.exports = {
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/brace-style": "off",
// [
// "error",
// "1tbs",
// {
// "allowSingleLine": true
// }
// ],
// TODO - investigate turning this on once we have correct settings
// "@typescript-eslint/naming-convention": [
// "error",
// {
// "selector": "default",
// "format": ["camelCase"]
// },
// {
// "selector": "variable",
// "format": ["camelCase"]
// },
// {
// "selector": "parameter",
// "format": ["camelCase"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "memberLike",
// "modifiers": ["private"],
// "format": ["camelCase"]
// },
// {
// "selector": "typeLike",
// "format": ["PascalCase"]
// }
// ],
"@typescript-eslint/comma-dangle": [
"error",
{
Expand Down
28 changes: 26 additions & 2 deletions common/build/eslint-config-fluid/minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
},
"extends": [
"./eslint7",
"@rushstack/eslint-config/profile/web-app",
"plugin:eslint-comments/recommended",
"plugin:import/errors",
"plugin:import/warnings",
Expand All @@ -31,11 +30,26 @@ module.exports = {
"project": "./tsconfig.json",
},
"plugins": [
// Plugin documentation: https://www.npmjs.com/package/@rushstack/eslint-plugin
"@rushstack/eslint-plugin",
// Plugin documentation: https://www.npmjs.com/package/@rushstack/eslint-plugin-security
"@rushstack/eslint-plugin-security",
// Plugin documentation: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin
"@typescript-eslint/eslint-plugin",
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-promise
"eslint-plugin-promise",
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-react
"react",
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-unicorn
"unicorn",
],
"reportUnusedDisableDirectives": true,
"rules": {

// The @rushstack rules are documented in the package README:
// https://www.npmjs.com/package/@rushstack/eslint-plugin
"@rushstack/no-new-null": "warn",

// RATIONALE: Harmless. Our guideline is to only use leading underscores on private members
// when required to avoid a conflict between private fields and a public property.
// Docs: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
Expand Down Expand Up @@ -73,7 +87,16 @@ module.exports = {
"code": 120
}
],
"no-multi-spaces": ["error", {"ignoreEOLComments": true}],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],

// Catches a common coding mistake where "resolve" and "reject" are confused.
"promise/param-names": "warn",

"unicorn/better-regex": "error",
"unicorn/filename-case": [
"error",
Expand All @@ -88,6 +111,7 @@ module.exports = {
"unicorn/no-unsafe-regex": "error",

// DISABLED INTENTIONALLY
// Disabled because we don't require that all variable declarations be explicitly typed.
"@rushstack/typedef-var": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
Expand Down