🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

standard-engine

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

standard-engine

Wrap your standards in a tortilla and cover it in special sauce.

15.1.0
latest
Version published
Weekly downloads
690K
8.31%
Maintainers
14
Weekly downloads
 
Created

What is standard-engine?

The standard-engine npm package is a tool for creating JavaScript style guides and enforcing code style rules. It provides a way to define and apply custom linting rules, ensuring code consistency and quality across projects.

What are standard-engine's main functionalities?

Linting

This feature allows you to create a custom linter using standard-engine. You can define your own linting rules and apply them to your project files.

const standardEngine = require('standard-engine');
const opts = { 
  cmd: 'my-linter', 
  version: '1.0.0', 
  homepage: 'https://example.com', 
  bugs: 'https://example.com/issues', 
  eslintConfig: { 
    configFile: 'path/to/eslint/config' 
  } 
};
const linter = standardEngine.linter(opts);
linter.lintFiles(['src/**/*.js'], (err, results) => { 
  if (err) throw err; 
  console.log(results); 
});

Fixing

This feature allows you to automatically fix linting errors in your code. By setting the `fix` option to true, standard-engine will attempt to correct any issues it finds.

const standardEngine = require('standard-engine');
const opts = { 
  cmd: 'my-linter', 
  version: '1.0.0', 
  homepage: 'https://example.com', 
  bugs: 'https://example.com/issues', 
  eslintConfig: { 
    configFile: 'path/to/eslint/config' 
  } 
};
const linter = standardEngine.linter(opts);
linter.lintFiles(['src/**/*.js'], { fix: true }, (err, results) => { 
  if (err) throw err; 
  console.log(results); 
});

Custom Reporters

This feature allows you to use custom reporters to format the linting results. You can define your own formatter and pass it to standard-engine.

const standardEngine = require('standard-engine');
const opts = { 
  cmd: 'my-linter', 
  version: '1.0.0', 
  homepage: 'https://example.com', 
  bugs: 'https://example.com/issues', 
  eslintConfig: { 
    configFile: 'path/to/eslint/config' 
  },
  customFormatter: require('my-custom-formatter') 
};
const linter = standardEngine.linter(opts);
linter.lintFiles(['src/**/*.js'], (err, results) => { 
  if (err) throw err; 
  console.log(results); 
});

Other packages similar to standard-engine

FAQs

Package last updated on 30 May 2023

Did you know?

Socket

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.

Install

Related posts