How to use @sheerun/eslint-config-standard - 3 common examples

To help you get started, we’ve selected a few @sheerun/eslint-config-standard 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 sheerun / prettier-standard / src / format-files.js View on Github external
}

  Object.keys(eslintConfig.rules).forEach(k => {
    if (fixable.indexOf(k) !== -1) {
      rules[k] = eslintConfig.rules[k]
    }
  })
  rules['jsx-quotes'] = ['error', 'prefer-single']

  const prettierESLintOptions = {
    logLevel,
    eslintPath,
    prettierPath,
    eslintConfig: {
      parser: getPathInHostNodeModules('babel-eslint'),
      parserOptions: eslintConfig.parserOptions,
      rules
    }
  }

  if (fileGlobs.length > 0) {
    return formatFilesFromGlobs(
      fileGlobs,
      ignoreGlobs.slice(), // make a copy to avoid manipulation
      { write: true },
      prettierESLintOptions,
      applyEslintIgnore
    )
  }

  return formatStdin(prettierESLintOptions)
}
github sheerun / prettier-standard / src / format-files.js View on Github external
) {
  logger.setLevel(logLevel)

  const eslint = require(eslintPath)
  const fixable = []
  const rules = {}

  if (eslint && eslint.linter) {
    eslint.linter.getRules().forEach((v, k) => {
      if (v.meta.fixable) {
        fixable.push(k)
      }
    })
  }

  Object.keys(eslintConfig.rules).forEach(k => {
    if (fixable.indexOf(k) !== -1) {
      rules[k] = eslintConfig.rules[k]
    }
  })
  rules['jsx-quotes'] = ['error', 'prefer-single']

  const prettierESLintOptions = {
    logLevel,
    eslintPath,
    prettierPath,
    eslintConfig: {
      parser: getPathInHostNodeModules('babel-eslint'),
      parserOptions: eslintConfig.parserOptions,
      rules
    }
  }
github sheerun / prettier-standard / src / format-files.js View on Github external
Object.keys(eslintConfig.rules).forEach(k => {
    if (fixable.indexOf(k) !== -1) {
      rules[k] = eslintConfig.rules[k]
    }
  })
  rules['jsx-quotes'] = ['error', 'prefer-single']

@sheerun/eslint-config-standard

JavaScript Standard Style - ESLint Shareable Config

MIT
Latest version published 6 years ago

Package Health Score

63 / 100
Full package analysis