How to use the tsconfig.findSync function in tsconfig

To help you get started, we’ve selected a few tsconfig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thorn0 / organize-imports-cli / cli.js View on Github external
writeLine: console.log.bind(console)
      };

  logger.writeLine(chalk`{yellowBright Organizing imports...}`);

  /**
   * @type {Record}
   */
  const projects = {};

  for (const filePath of filePaths) {
    const tsConfigFilePath = tsconfig.findSync(path.dirname(filePath));
    const projectEntry = tsConfigFilePath && projects[tsConfigFilePath];

    if (projectEntry) {
      const sourceFile = projectEntry.project.getSourceFile(filePath);

      if (sourceFile) {
        if (projectEntry.files !== "all") {
          projectEntry.files.push(sourceFile);
        }
        continue;
      }
    }

    const ec = editorconfig.parseSync(filePath);
    const manipulationSettings = getManipulationSettings(ec);
    const detectNewLineKind = !!ec.end_of_line;

tsconfig

Resole and parse `tsconfig.json`, replicating to TypeScript's behaviour

MIT
Latest version published 7 years ago

Package Health Score

71 / 100
Full package analysis