• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

linter-js-tenx

Linter plugin for Ten-X using JavaScript Standard Style.
  • #javascript
  • #standard
  • #linter
jeremyosborne
4.0.1 2,694
0
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

linter-js-tenx

js-standard-style

This is a fork from linter-js-standard, but specifically for the team I work with and designed to work with just the js standard style.

Installation

  • Install linter.
  • Install this plugin through the package manager within the editor or from command line:
apm install linter-js-tenx

Features

  • Enforce standard style.
  • Optionally lint fenced JavaScript code in markdown files.
  • Optionally require a project to opt in to using this plugin. Saves you when you have to handle different projects, and some of them are standard style, and some of them are not.
  • Optionally use a standard parser npm installed within a project. Allows different projects to use their own version of the standard linter when you don't want to use the one included with this plugin.
  • Configured on a per project basis via package.json:
    • Ignore declared global variables (per regular standard configuration).
    • Allow for custom parsers.
    • Ignore linting of files based on glob patterns.

Plugin settings

lintMarkdownFiles (default: false)

Lint markdown fenced code blocks.

requireStandardInPackageJson (default: false)

Only lint if the project has opted in to js-standard by declaring standard as (1) a dependency in dependencies or devDependencies, or (2) declaring a top-level standard config block. Allows this plugin to exist along with other linter plugins and be off by default.

Note: This will opt for the package.json located in the project folder.

preferProjectStandard (default: false)

If the parent project includes standard in dependencies or devDependencies, and it is npm installed in the project node_modules, then use that version from the project. If not npm installed, the plugin will log a warning to the atom console (should you wish to debug if the lint errors you are getting are unexpected) and will use the one included in this plugin.

showEslintRules (default: false)

Enable/disable showing the id of the offended eslint rules.

Plugin configuration via package.json

The plugin will respect an extended standard configuration object located inside of your project's package.json file.

Global variable support

To have the linter not warn about undeclared variables when using global variables, add a globals section to package.json:

{
  "standard": {
    "globals": [
      "var1",
      "var2"
    ]
  }
}

See: https://github.com/feross/standard#i-use-a-library-that-pollutes-the-global-namespace-how-do-i-prevent-variable-is-not-defined-errors

Use a custom parser

Custom parsers currently supported:

  • esprima
  • esprima-fb
  • babel-eslint

To use a custom parser, extend the standard object in your package.json file:

{
  "standard": {
    "parser": "esprima"
  }
}

Ignore files while linting

To opt to ignore files from linting, extend the standard object in your package.json file with a single glob expression:

{
  "standard": {
    "ignore": "*.spec.js"
  }
}

or an array of glob expressions:

{
  "standard": {
    "ignore": ["*.spec.js", "*.legacy.js"]
  }
}

If the file open in the editor would have normally been linted, but the file path matches one of the glob patterns, it will not be linted.

See: https://github.com/isaacs/minimatch

License

MIT

Rubber Duck Notes

This is the second atom plugin that I've worked on and have decided to make rubber duck coding notes to myself. I may remove these notes over time, but for now I'm leaving them here for myself and anyone who may want them.

My dev procedure for working on this plugin:

# These commands are mac-centric, but could be tweaked for other systems 
 
# Link this plugin to my atom app, run inside this directory 
atom link
 
# Launch atom in dev mode (from terminal) 
atom -d
 
# When in dev mode and I've made changes to the package, restart atom to 
# recognize the changes 
ctrl-opt-cmd-L

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by