Interface for creating Atom Linters around unified processors. Wrapper around the engine to run it from Atom.
npm:
npm install unified-engine-atom
var engine = require('unified-engine-atom');
module.exports.provideLinter = function () {
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'
})
};
}
Create a lint
function for use in an AtomLinter package. Read more
about linters in the Linter Docs.
processor
(Processor
, required) — Unified processor to transform files.rcName
(string
, optional) — Name of configuration files to load.packageField
(string
, optional) — Property at which configuration can be found inpackage.json
files.detectConfig
(boolean
, default: whetherrcName
orpackageField
is given) — Whether to search for configuration files.rcPath
(string
, optional) — File-path to a configuration file to load.settings
(Object
, optional) — Configuration for the parser and compiler of the processor.ignoreName
(string
, optional) — Name of ignore files to load.detectIgnore
(boolean
, default: whetherignoreName
is given) — Whether to search for ignore files.ignorePath
(string
, optional) — File-path to an ignore file to load.silentlyIgnore
(boolean
, default:false
) — Skip given files if they are ignored.plugins
(Object
, optional) — Map of plug-in names or paths and options to use.pluginPrefix
(string
, optional) — When given, optional prefix to use when searching for plug-ins.
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
.
- If anyone knows how to add coverage to Atom tests, I’d love to hear about it.