Skip to content

Make a few exceptions to the standard rules #2

@zeke

Description

@zeke

The standard linter has a few rules that feel restrictive when applied to javascript blocks in markdown files. While standardizing electron's docs, these are the rules I came across that I think we could do without:

Disallow Undeclared Variables (no-undef)

// `win` is not declared in this block
win.close()

Disallow Unused Variables (no-unused-vars)

// `BrowserWindow` is declared but not used
const {BrowserWindow} = require('electron')

Disallow Unnecessary Nested Blocks (no-lone-blocks, no-labels)

Example electron/electron#6748

// this object is just dangling in space
{
  marginsType: 0,
  printBackground: false
}

How?

I think the way to accomplish this is by forking eslint-config-standard, then using standard-engine to load it. We can use the numerous standard forks for reference.

@ferros, @Flet: If we only wish to deviate very slightly from standard's defaults, is there a way to codify the differences in a package.json stanza? Or is standard-engine with a custom eslint package the way to go?

cc @kevinsawicki @jlord @zcbenz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions