How to use the eslint-config-standard.rules function in eslint-config-standard

To help you get started, we’ve selected a few 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 sourcegraph / sourcegraph / extensions / enterprise / check-search / src / eslint.ts View on Github external
const docs = await Promise.all(
            results.map(async ({ uri }) => sourcegraph.workspace.openTextDocument(new URL(uri)))
        )

        const tseslintConfig: TSESLint.ParserOptions = {
            ecmaVersion: 2018,
            range: true,
            sourceType: 'module',
            filePath: 'foo.tsx',
            useJSXTextNode: true,
            ecmaFeatures: { jsx: true },
        }
        const linter = new Linter()
        linter.defineParser('@typescript-eslint/parser', tseslintParser)

        const stdRules = _eslintConfigStandard.rules
        for (const ruleId of Object.keys(stdRules)) {
            if (!linter.getRules().has(ruleId)) {
                delete stdRules[ruleId]
            }
        }
        // delete stdRules.indent
        // delete stdRules['space-before-function-paren']
        // delete stdRules['no-undef']
        // delete stdRules['comma-dangle']
        // delete stdRules['no-unused-vars']

        const config: Linter.Config = {
            parser: '@typescript-eslint/parser',
            parserOptions: tseslintConfig,
            rules: {
                ...stdRules,

eslint-config-standard

JavaScript Standard Style - ESLint Shareable Config

MIT
Latest version published 1 year ago

Package Health Score

84 / 100
Full package analysis

Popular eslint-config-standard functions