standard
Advanced tools
Comparing version 16.0.4 to 17.0.0-0
#!/usr/bin/env node | ||
/* eslint-disable no-var */ | ||
/* eslint-disable no-var, no-eval */ | ||
@@ -8,6 +8,10 @@ var match = process.version.match(/v(\d+)\.(\d+)/) | ||
if (major >= 11 || (major === 10 && minor >= 12)) { | ||
require('standard-engine').cli(require('../options')) | ||
if (major >= 12 || (major === 12 && minor >= 20)) { | ||
eval('import("standard-engine")').then(function (standardEngine) { | ||
eval('import("../options.js")').then(function (options) { | ||
standardEngine.cli(options.default) | ||
}) | ||
}) | ||
} else { | ||
console.error('standard: Node 10.12.0 or greater is required. `standard` did not run.') | ||
console.error('standard: Node 12.20.0 or greater is required. `standard` did not run.') | ||
} |
/*! standard. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
const Linter = require('standard-engine').linter | ||
const opts = require('./options') | ||
import { StandardEngine } from 'standard-engine' | ||
import options from './options.js' | ||
module.exports = new Linter(opts) | ||
export default new StandardEngine(options) |
@@ -1,6 +0,12 @@ | ||
const eslint = require('eslint') | ||
const path = require('path') | ||
const pkg = require('./package.json') | ||
import { readFileSync } from 'node:fs' | ||
import { fileURLToPath } from 'node:url' | ||
import eslint from 'eslint' | ||
module.exports = { | ||
// eslintConfig.overrideConfigFile have problem reading URLs and file:/// | ||
const overrideConfigFile = fileURLToPath(new URL('./eslintrc.json', import.meta.url)) | ||
const pkgURL = new URL('./package.json', import.meta.url) | ||
const pkgJSON = readFileSync(pkgURL, { encoding: 'utf-8' }) | ||
const pkg = JSON.parse(pkgJSON) | ||
export default { | ||
bugs: pkg.bugs.url, | ||
@@ -10,3 +16,3 @@ cmd: 'standard', | ||
eslintConfig: { | ||
configFile: path.join(__dirname, 'eslintrc.json') | ||
overrideConfigFile | ||
}, | ||
@@ -13,0 +19,0 @@ homepage: pkg.homepage, |
{ | ||
"name": "standard", | ||
"description": "JavaScript Standard Style", | ||
"version": "16.0.4", | ||
"version": "17.0.0-0", | ||
"author": { | ||
@@ -13,2 +13,3 @@ "name": "Feross Aboukhadijeh", | ||
}, | ||
"type": "module", | ||
"bugs": { | ||
@@ -18,10 +19,10 @@ "url": "https://github.com/standard/standard/issues" | ||
"dependencies": { | ||
"eslint": "~7.18.0", | ||
"eslint-config-standard": "16.0.3", | ||
"eslint-config-standard-jsx": "10.0.0", | ||
"eslint-plugin-import": "~2.24.2", | ||
"eslint-plugin-node": "~11.1.0", | ||
"eslint-plugin-promise": "~5.1.0", | ||
"eslint-plugin-react": "~7.25.1", | ||
"standard-engine": "^14.0.1" | ||
"eslint": "^8.8.0", | ||
"eslint-config-standard": "17.0.0-0", | ||
"eslint-config-standard-jsx": "11.0.0-0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-n": "^14.0.0", | ||
"eslint-plugin-promise": "^6.0.0", | ||
"eslint-plugin-react": "^7.28.0", | ||
"standard-engine": "^15.0.0-0" | ||
}, | ||
@@ -35,6 +36,6 @@ "devDependencies": { | ||
"simple-get": "^4.0.0", | ||
"tape": "^5.3.1" | ||
"tape": "^5.3.2" | ||
}, | ||
"engines": { | ||
"node": ">=10.12.0" | ||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" | ||
}, | ||
@@ -41,0 +42,0 @@ "homepage": "https://standardjs.com", |
@@ -214,4 +214,3 @@ <h1 align="center"> | ||
| [<img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/jublia.png>](https://jublia.com/) | [<img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/atom.png>](https://atom.io) | Your logo here | Your logo here | | ||
| [<img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/jublia.png>](https://jublia.com/) | [<img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/atom.png>](https://atom.io) | [<img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/peek.png>](https://www.peek.com) | Your Logo Here | | ||
|---|---|---|---| | ||
@@ -359,3 +358,3 @@ | ||
[bikeshedding]: https://www.freebsd.org/doc/en/books/faq/misc.html#bikeshed-painting | ||
[bikeshedding]: https://docs.freebsd.org/en/books/faq/#bikeshed-painting | ||
@@ -414,10 +413,2 @@ ## But this isn't a real web standard! | ||
To get verbose output (so you can find the particular rule name to ignore), run: | ||
```bash | ||
$ standard --verbose | ||
Error: Use JavaScript Standard Style | ||
routes/error.js:20:36: 'file' was used before it was defined. (no-use-before-define) | ||
``` | ||
Disable **all rules** on a specific line: | ||
@@ -743,3 +734,3 @@ | ||
```bash | ||
$ standard --verbose | snazzy | ||
$ standard | snazzy | ||
``` | ||
@@ -756,3 +747,3 @@ | ||
### `standard.lintText(text, [opts], callback)` | ||
### `async standard.lintText(text, [opts])` | ||
@@ -763,21 +754,28 @@ Lint the provided source `text`. An `opts` object may be provided: | ||
{ | ||
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-parser) | ||
// unique to lintText | ||
filename: '', // path of file containing the text being linted | ||
// common to lintText and lintFiles | ||
cwd: '', // current working directory (default: process.cwd()) | ||
fix: false, // automatically fix problems | ||
extensions: [], // file extensions to lint (has sane defaults) | ||
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? | ||
useGitIgnore: true // use file ignore patterns from .gitignore? | ||
} | ||
``` | ||
Additional options may be loaded from a `package.json` if it's found for the | ||
current working directory. | ||
All options are optional, though some ESLint plugins require the `filename` option. | ||
The `callback` will be called with an `Error` and `results` object. | ||
Additional options may be loaded from a `package.json` if it's found for the current working directory. See below for further details. | ||
Returns a `Promise` resolving to the `results` or rejected with an `Error`. | ||
The `results` object will contain the following properties: | ||
```js | ||
var results = { | ||
const results = { | ||
results: [ | ||
@@ -799,25 +797,30 @@ { | ||
### `results = standard.lintTextSync(text, [opts])` | ||
### `async standard.lintFiles(files, [opts])` | ||
Synchronous version of `standard.lintText()`. If an error occurs, an exception is | ||
thrown. Otherwise, a `results` object is returned. | ||
### `standard.lintFiles(files, [opts], callback)` | ||
Lint the provided `files` globs. An `opts` object may be provided: | ||
```js | ||
var opts = { | ||
ignore: [], // file globs to ignore (has sane defaults) | ||
cwd: '', // current working directory (default: process.cwd()) | ||
fix: false, // automatically fix problems | ||
globals: [], // global variables to declare | ||
plugins: [], // eslint plugins | ||
envs: [], // eslint environment | ||
parser: '' // js parser (e.g. @babel/eslint-parser) | ||
{ | ||
// unique to lintFiles | ||
ignore: [], // file globs to ignore (has sane defaults) | ||
// common to lintText and lintFiles | ||
cwd: '', // current working directory (default: process.cwd()) | ||
fix: false, // automatically fix problems | ||
extensions: [], // file extensions to lint (has sane defaults) | ||
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? | ||
useGitIgnore: true // use file ignore patterns from .gitignore? | ||
} | ||
``` | ||
The `callback` will be called with an `Error` and `results` object (same as above). | ||
Additional options may be loaded from a `package.json` if it's found for the current working directory. See below for further details. | ||
Both `ignore` and `files` patterns are resolved relative to the current working directory. | ||
Returns a `Promise` resolving to the `results` or rejected with an `Error` (same as above). | ||
## How do I contribute to StandardJS? | ||
@@ -824,0 +827,0 @@ |
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
161260
40
849
0
Yes
1
+ Addedeslint-plugin-n@^14.0.0
+ Added@eslint-community/eslint-utils@4.4.0(transitive)
+ Added@eslint-community/regexpp@4.10.0(transitive)
+ Added@eslint/eslintrc@2.1.4(transitive)
+ Added@eslint/js@8.57.0(transitive)
+ Added@humanwhocodes/config-array@0.11.14(transitive)
+ Added@humanwhocodes/module-importer@1.0.1(transitive)
+ Added@humanwhocodes/object-schema@2.0.3(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@ungap/structured-clone@1.2.0(transitive)
+ Addedacorn@8.11.3(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedarray.prototype.findlast@1.2.5(transitive)
+ Addedarray.prototype.findlastindex@1.2.5(transitive)
+ Addedarray.prototype.toreversed@1.1.2(transitive)
+ Addedarray.prototype.tosorted@1.1.3(transitive)
+ Addedes-iterator-helpers@1.0.19(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedeslint@8.57.0(transitive)
+ Addedeslint-config-standard@17.0.0-0(transitive)
+ Addedeslint-config-standard-jsx@11.0.0-0(transitive)
+ Addedeslint-plugin-es@4.1.0(transitive)
+ Addedeslint-plugin-import@2.29.1(transitive)
+ Addedeslint-plugin-n@14.0.0(transitive)
+ Addedeslint-plugin-promise@6.1.1(transitive)
+ Addedeslint-plugin-react@7.34.1(transitive)
+ Addedeslint-scope@7.2.2(transitive)
+ Addedeslint-utils@3.0.0(transitive)
+ Addedeslint-visitor-keys@3.4.3(transitive)
+ Addedespree@9.6.1(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedglob-parent@6.0.2(transitive)
+ Addedglobals@13.24.0(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgraphemer@1.4.0(transitive)
+ Addedis-async-function@2.0.0(transitive)
+ Addedis-finalizationregistry@1.0.2(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-map@2.0.3(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedis-set@2.0.3(transitive)
+ Addedis-weakmap@2.0.2(transitive)
+ Addedis-weakset@2.0.3(transitive)
+ Addediterator.prototype@1.1.2(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlodash.merge@4.6.2(transitive)
+ Addedobject.groupby@1.0.3(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreflect.getprototypeof@1.0.6(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedstandard-engine@15.1.0(transitive)
+ Addedtype-fest@0.20.2(transitive)
+ Addedwhich-builtin-type@1.1.3(transitive)
+ Addedwhich-collection@1.0.2(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removedeslint-plugin-node@~11.1.0
- Removed@babel/code-frame@7.24.2(transitive)
- Removed@babel/helper-validator-identifier@7.24.5(transitive)
- Removed@babel/highlight@7.24.5(transitive)
- Removed@eslint/eslintrc@0.3.0(transitive)
- Removedacorn@7.4.1(transitive)
- Removedajv@8.13.0(transitive)
- Removedansi-colors@4.1.3(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedastral-regex@2.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedenquirer@2.4.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedeslint@7.18.0(transitive)
- Removedeslint-config-standard@16.0.3(transitive)
- Removedeslint-config-standard-jsx@10.0.0(transitive)
- Removedeslint-plugin-es@3.0.1(transitive)
- Removedeslint-plugin-import@2.24.2(transitive)
- Removedeslint-plugin-node@11.1.0(transitive)
- Removedeslint-plugin-promise@5.1.1(transitive)
- Removedeslint-plugin-react@7.25.3(transitive)
- Removedeslint-scope@5.1.1(transitive)
- Removedespree@7.3.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@4.3.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedfunctional-red-black-tree@1.0.1(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobals@12.4.0(transitive)
- Removedhas@1.0.4(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedignore@4.0.6(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjson-schema-traverse@1.0.0(transitive)
- Removedload-json-file@4.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.truncate@4.4.2(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedms@2.0.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpicocolors@1.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedpkg-up@2.0.0(transitive)
- Removedprogress@2.0.3(transitive)
- Removedread-pkg@3.0.0(transitive)
- Removedread-pkg-up@3.0.0(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedsemver@5.7.27.6.0(transitive)
- Removedslice-ansi@4.0.0(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.17(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstandard-engine@14.0.1(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedtable@6.8.2(transitive)
- Removedtype-fest@0.8.1(transitive)
- Removedv8-compile-cache@2.4.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedyallist@4.0.0(transitive)
Updatedeslint@^8.8.0
Updatedeslint-plugin-import@^2.25.4
Updatedeslint-plugin-promise@^6.0.0
Updatedeslint-plugin-react@^7.28.0
Updatedstandard-engine@^15.0.0-0