Download examples/bluetooth/react-native-macos/typecheck.cjs from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/examples/bluetooth/react-native-macos/typecheck.cjs
- Command line
-
hf download hf://Anirudh1950/MentraOS/examples/bluetooth/react-native-macos/typecheck.cjs
-
curl -L -o typecheck.cjs https://huggingface.co/Anirudh1950/MentraOS/resolve/main/examples/bluetooth/react-native-macos/typecheck.cjs
1.17 kB
| const path = require('node:path'); | |
| const ts = require('typescript'); | |
| const config = ts.getParsedCommandLineOfConfigFile(path.join(__dirname, 'tsconfig.json'), {}, { | |
| ...ts.sys, | |
| onUnRecoverableConfigFileDiagnostic: diagnostic => { | |
| console.error(ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')); | |
| process.exit(1); | |
| }, | |
| }); | |
| // Match Metro's Mac host: React Native resolves to react-native-macos. | |
| config.options.paths = { | |
| 'react': [path.join(__dirname, 'node_modules/@types/react')], | |
| 'react/*': [path.join(__dirname, 'node_modules/@types/react/*')], | |
| 'react-native': [path.join(__dirname, 'node_modules/react-native-macos')], | |
| 'react-native/*': [path.join(__dirname, 'node_modules/react-native-macos/*')], | |
| }; | |
| const program = ts.createProgram(config.fileNames, config.options); | |
| const diagnostics = [...config.errors, ...ts.getPreEmitDiagnostics(program)]; | |
| if (diagnostics.length) { | |
| console.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, { | |
| getCanonicalFileName: name => name, | |
| getCurrentDirectory: ts.sys.getCurrentDirectory, | |
| getNewLine: () => ts.sys.newLine, | |
| })); | |
| process.exit(1); | |
| } | |