standard-engine
Advanced tools
Comparing version 7.2.0 to 8.0.0
16
index.js
@@ -57,6 +57,7 @@ module.exports.cli = require('./bin/cmd') | ||
* @param {string=} opts.parser custom js parser (e.g. babel-eslint) | ||
* @param {string=} opts.filename path of the file containing the text being linted | ||
* @param {string=} opts.filename path of file containing the text being linted | ||
* @param {boolean=} opts.usePackageJson use options from nearest package.json? (default: true) | ||
*/ | ||
Linter.prototype.lintTextSync = function (text, opts) { | ||
opts = this.parseOpts(opts, false) | ||
opts = this.parseOpts(opts) | ||
return new this.eslint.CLIEngine(opts.eslintConfig).executeOnText(text, opts.filename) | ||
@@ -88,2 +89,3 @@ } | ||
* @param {string=} opts.parser custom js parser (e.g. babel-eslint) | ||
* @param {boolean=} opts.usePackageJson use options from nearest package.json? (default: true) | ||
* @param {function(Error, Object)} cb callback | ||
@@ -94,3 +96,3 @@ */ | ||
if (typeof opts === 'function') return self.lintFiles(files, null, opts) | ||
opts = self.parseOpts(opts, true) | ||
opts = self.parseOpts(opts) | ||
@@ -125,3 +127,3 @@ if (typeof files === 'string') files = [ files ] | ||
Linter.prototype.parseOpts = function (opts, usePackageJson) { | ||
Linter.prototype.parseOpts = function (opts) { | ||
var self = this | ||
@@ -135,2 +137,8 @@ | ||
if (!opts.cwd) opts.cwd = self.cwd || process.cwd() | ||
// If no usePackageJson option is given, default to `true` | ||
var usePackageJson = opts.usePackageJson != null | ||
? opts.usePackageJson | ||
: true | ||
var packageOpts = usePackageJson | ||
@@ -137,0 +145,0 @@ ? pkgConf.sync(self.cmd, { cwd: opts.cwd }) |
{ | ||
"name": "standard-engine", | ||
"description": "Wrap your standards in a tortilla and cover it in special sauce.", | ||
"version": "7.2.0", | ||
"version": "8.0.0", | ||
"author": "Dan Flettre <flettre@gmail.com> (http://twitter.com/flettre/)", | ||
@@ -16,16 +16,14 @@ "bugs": { | ||
"devDependencies": { | ||
"babel-eslint": "^7.1.1", | ||
"cross-spawn": "^5.0.0", | ||
"eslint": "^3.0.1", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-config-standard-jsx": "^4.0.2", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-node": "^4.2.2", | ||
"eslint-plugin-promise": "^3.4.0", | ||
"eslint-plugin-react": "^6.0.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"babel-eslint": "^8.2.1", | ||
"cross-spawn": "^6.0.3", | ||
"eslint": "*", | ||
"eslint-config-standard": "*", | ||
"eslint-config-standard-jsx": "*", | ||
"eslint-plugin-import": "*", | ||
"eslint-plugin-node": "*", | ||
"eslint-plugin-promise": "*", | ||
"eslint-plugin-react": "*", | ||
"eslint-plugin-standard": "*", | ||
"mkdirp": "^0.5.0", | ||
"run-parallel-limit": "^1.0.1", | ||
"standard": "*", | ||
"standard-packages": "^3.0.14", | ||
"tape": "^4.0.0" | ||
@@ -66,7 +64,4 @@ }, | ||
"scripts": { | ||
"test": "standard && tape test/clone.js test/api.js", | ||
"test-offline": "npm test -- --offline", | ||
"test-quick": "npm test -- --quick", | ||
"test-offline-quick": "npm test -- --offline --quick" | ||
"test": "standard && tape test/*.js" | ||
} | ||
} |
@@ -278,12 +278,15 @@ # standard-engine [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] | ||
{ | ||
cwd: '', // current working directory (default: process.cwd()) | ||
filename: '', // path of the file containing the text being linted (optional, though some eslint plugins require it) | ||
fix: false, // automatically fix problems | ||
globals: [], // custom global variables to declare | ||
plugins: [], // custom eslint plugins | ||
envs: [], // custom eslint environment | ||
parser: '' // custom js parser (e.g. babel-eslint) | ||
cwd: '', // current working directory (default: process.cwd()) | ||
filename: '', // path of file containing the text being linted | ||
fix: false, // automatically fix problems | ||
globals: [], // custom global variables to declare | ||
plugins: [], // custom eslint plugins | ||
envs: [], // custom eslint environment | ||
parser: '', // custom js parser (e.g. babel-eslint) | ||
usePackageJson: true // use options from nearest package.json? | ||
} | ||
``` | ||
All options are optional, though some ESLint plugins require the `filename` option. | ||
Additional options may be loaded from a `package.json` if it's found for the current working directory. See below for further details. | ||
@@ -324,9 +327,10 @@ | ||
{ | ||
ignore: [], // file globs to ignore (has sane defaults) | ||
cwd: '', // current working directory (default: process.cwd()) | ||
fix: false, // automatically fix problems | ||
globals: [], // custom global variables to declare | ||
plugins: [], // custom eslint plugins | ||
envs: [], // custom eslint environment | ||
parser: '' // custom js parser (e.g. babel-eslint) | ||
ignore: [], // file globs to ignore (has sane defaults) | ||
cwd: '', // current working directory (default: process.cwd()) | ||
fix: false, // automatically fix problems | ||
globals: [], // custom global variables to declare | ||
plugins: [], // custom eslint plugins | ||
envs: [], // custom eslint environment | ||
parser: '', // custom js parser (e.g. babel-eslint) | ||
usePackageJson: true // use options from nearest package.json? | ||
} | ||
@@ -333,0 +337,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36814
13
11
438
375
1