Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

unifiedjs/unified-engine-atom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

unified processor to transform files (Processor, required).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • If anyone knows how to add coverage to Atom tests, I’d love to hear about it.

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

About

Engine to create Atom linters for unified

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors