Download next.js/packages/next/src/lib/eslint/getESLintPromptValues.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/lib/eslint/getESLintPromptValues.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/lib/eslint/getESLintPromptValues.ts
-
curl -L -o getESLintPromptValues.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/lib/eslint/getESLintPromptValues.ts
684 Bytes
| import findUp from 'next/dist/compiled/find-up' | |
| export const getESLintStrictValue = async (cwd: string) => { | |
| const tsConfigLocation = await findUp('tsconfig.json', { cwd }) | |
| const hasTSConfig = tsConfigLocation !== undefined | |
| return { | |
| title: 'Strict', | |
| recommended: true, | |
| config: { | |
| extends: hasTSConfig | |
| ? ['next/core-web-vitals', 'next/typescript'] | |
| : 'next/core-web-vitals', | |
| }, | |
| } | |
| } | |
| export const getESLintPromptValues = async (cwd: string) => { | |
| return [ | |
| await getESLintStrictValue(cwd), | |
| { | |
| title: 'Base', | |
| config: { | |
| extends: 'next', | |
| }, | |
| }, | |
| { | |
| title: 'Cancel', | |
| config: null, | |
| }, | |
| ] | |
| } | |