unified

Project: unifiedjs/unified-engine-atom

Package: unified-engine-atom@9.0.0

  1. Dependencies: 3·Dependents: 1
  2. unified engine to create an Atom Linters for a processor
  1. unified 143
  2. engine 4
  3. processor 4

unified-engine-atom

Build Downloads Sponsors Backers Chat

unified engine to create an Atom Linters for a processor. Wrapper around the unifiedjs/unified-engine to run it from Atom.

Install

npm:

npm install unified-engine-atom

Use

var engine = require('unified-engine-atom')

module.exports.provideLinter = linter

function linter() {
  return {
    grammarScopes: ['source.gfm', 'source.pfm', 'text.md'],
    name: 'remark',
    scope: 'file',
    lintsOnChange: true,
    lint: engine({
      processor: require('remark'),
      rcName: '.remarkrc',
      packageField: 'remarkConfig',
      ignoreName: '.remarkignore',
      pluginPrefix: 'remark'
    })
  }
}

API

engine(options)

Create a lint function for use in an AtomLinter package. Read more about linters in the Linter Docs.

options
options.processor

unified processor to transform files (Processor, required).

options.rcName

Name of configuration files to load (string, optional).

options.packageField

Property at which configuration can be found in package.json files (string, optional).

options.detectConfig

Whether to search for configuration files (boolean, default: whether rcName or packageField is given).

options.rcPath

File-path to a configuration file to load (string, optional).

options.settings

Configuration for the parser and compiler of the processor (Object, optional).

options.ignoreName

Name of ignore files to load (string, optional).

options.detectIgnore

Whether to search for ignore files (boolean, default: whether ignoreName is given).

options.ignorePath

File-path to an ignore file to load (string, optional).

options.ignorePathResolveFrom

Whether to resolve patterns in ignorePath relative to its directory or the current working directory ('dir' or 'cwd', default: 'dir').

options.ignorePatterns

Extra patterns to ignore in combination with ignorePath or found ignores (Array.<string>, optional).

options.silentlyIgnore

Skip given files if they are ignored (boolean, default: false).

options.plugins

Map of plugin names or paths and options to use (Object, optional).

options.pluginPrefix

When given, optional prefix to use when searching for plugins (string, optional).

options.configTransform

Transform config files from a different schema (Function, optional).

Returns

Function — Can be used as provider.lint, where provider is the returned value of provideLinter. This function takes an Atom Editor instance, resolves an array of LinterMessages, or rejects a fatal Error.

Todo

Contribute

See contributing.md in unifiedjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer