-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(eslint): setup typescript-eslint/recommended (#6577)
* chore: remove unused utils/components/packages * initial eslint/prettier setup * merge RemoveUnusedCode * fix(linting errors): single quotes in text * Remove WhatsNewBanner * Remove WhatsNewBanner * fix(linting errors): single quotes in text * add rule to throw eslint error for react hooks dependencies instead of a warning * Remove unused InfoPopover * Remove unused InfoPopover * fix(linting errors): do not pass children as prop in Block test * fix(linting errors): fix next img warnings * fix(linting errors): missing hook dependency GetStartedPopover * fix(linting error): move handleScroll to its own useEffect w/o dependency array * fix(linting error): missing hook dependency in MDXCode * fix(linting error): order of hooks MDXLink * fix(linting error): missing hook dependency PlatformNavigator * fix(linting error): convert findRoute to hook, useRouteFinder, move to separate utils file * fix(lint errors): MenuItem and type update * fix(lint errors): make 3rd party scripts load async * fix(linting error): cleanup function in hook useTabKeyDetection * change 3rd party scripts to defer * clean up eslint warnings in next.config.mjs * use next ExportedImage instead of Image * chore(eslint): setup typescript-eslint/recommended * remove @typescript-eslint/parser, its already included * fix unused vars, const/let * Switch awshome_s_code to async to fix track errors * Fix unused imports and const/let variables * use typescript/eslint for unused vars * add linting to staged files with husky * update lintstagedrc * Add prettier to husky precommit * downgrade lint-staged to v14 to work with node16 * update prettierignore * ignore mdx files for now * Remove SidebarLayoutToggle * remove unified and mdx-prism * remove comments * add eslint ignore for 3rd party script we have to load sync * add comment about prettier coming last
- Loading branch information
Showing
30 changed files
with
106 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
{ | ||
"extends": ["next/core-web-vitals", "prettier"], | ||
"plugins": ["prettier"], | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" // prettier should always come last | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"rules": { | ||
"react-hooks/exhaustive-deps": "error" | ||
"react-hooks/exhaustive-deps": "error", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/components/FilterChildren/__tests__/FilterChildren.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import directory from '../directory/directory.json'; | ||
|
||
export const findDirectoryNode = (route, dir = directory) => { | ||
if(dir.route === route){ | ||
return dir | ||
}else if(dir.children && dir.children.length){ | ||
for(let i = 0; i < dir.children.length; i++){ | ||
let child = dir.children[i]; | ||
let res = findDirectoryNode(route, child); | ||
if(res) return res; | ||
} | ||
if (dir.route === route) { | ||
return dir; | ||
} else if (dir.children && dir.children.length) { | ||
for (let i = 0; i < dir.children.length; i++) { | ||
const child = dir.children[i]; | ||
const res = findDirectoryNode(route, child); | ||
if (res) return res; | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.