![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
atom-linter
Advanced tools
atom-linter is an npm helper module that you can import in your Linter Providers and make things easier for yourself.
For full documentation of exec
and execNode
API, please refer to sb-exec README
export const FindCache: Map
export function exec(command: String, args: Array<string> = [], options: Object): Promise
export function execNode(filePath: String, args: Array<string> = [], options: Object): Promise
export function parse(data: String, regex: String, options: Object = {flags: 'g'}): Array<Linter$Message>
export function generateRange(textEditor: TextEditor, lineNumber: Number = 0, colStart: Number = <firstTextColumn>): Array
export function find(directory: String, names: String | Array<string>): ?String
export function findCached(directory: String, names: String | Array<string>): ?String
export function findAsync(directory: String, names: String | Array<string>): Promise<?String>
export function findCachedAsync(directory: String, names: String | Array<string>): Promise<?String>
export function tempFile<T>(fileName: String, fileContents: String, callback: Function<T>): Promise<T>
export function tempFiles<T>(filesNames: Array<{ name: String, contents: String }>, callback: Function<T>): Promise<T>
To make sure that old processes spawned by your linter provider are terminated on a newer invocation, you can specify uniqueKey: "my-linter"
in exec
or execNode
options. Please note that killed processes will return null
as return value, so make sure to handle that.
Example:
import atomLinter from 'atom-linter'
const myLinter = {
// ...
async lint(textEditor) {
const output = atomLinter.exec('myprogram', ['parameter1', 'parameter2'], { uniqueKey: 'my-linter' })
// NOTE: Providers should also return null if they get null from exec
// Returning null from provider will tell base linter to keep existing messages
if (output === null) {
return null
}
// ... parse output and return messages
return []
}
}
This project is licensed under the terms of MIT License, see the LICENSE file for more info
10.0.0
uniqueKey
support to exec optionsthrowOnStdErr
to `throwOnStderrBuffer
s in options.stdin
FAQs
Helper module for atom linter providers
The npm package atom-linter receives a total of 95 weekly downloads. As such, atom-linter popularity was classified as not popular.
We found that atom-linter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.