Socket
Socket
Sign inDemoInstall

standard

Package Overview
Dependencies
234
Maintainers
16
Versions
183
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 16.0.4 to 17.0.0-0

12

bin/cmd.js
#!/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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc