Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

standard

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

standard - npm Package Compare versions

Comparing version 2.2.6 to 2.3.0

14

index.js

@@ -9,6 +9,2 @@ var cp = require('child_process')

var JSHINT = path.join(__dirname, 'node_modules', '.bin', 'jshint')
var JSHINT_RC = path.join(__dirname, 'rc', '.jshintrc')
var JSHINT_REPORTER = path.join(__dirname, 'lib', 'jshint-reporter.js')
var JSCS = path.join(__dirname, 'node_modules', '.bin', 'jscs')

@@ -25,4 +21,4 @@ var JSCS_RC = path.join(__dirname, 'rc', '.jscsrc')

if (/^win/.test(process.platform)) {
JSHINT += '.cmd'
JSCS += '.cmd'
ESLINT += '.cmd'
}

@@ -66,4 +62,2 @@

var jshintArgs = ['--config', JSHINT_RC, '--reporter', JSHINT_REPORTER]
var jscsReporter = opts.verbose ? JSCS_REPORTER_VERBOSE : JSCS_REPORTER

@@ -76,3 +70,2 @@ var jscsArgs = ['--config', JSCS_RC, '--reporter', jscsReporter]

if (opts.verbose) {
jshintArgs.push('--verbose')
jscsArgs.push('--verbose')

@@ -83,3 +76,2 @@ }

// stdin
jshintArgs.push('-')
eslintArgs.push('--stdin')

@@ -104,3 +96,2 @@ lint()

})
jshintArgs = jshintArgs.concat(files)
jscsArgs = jscsArgs.concat(files)

@@ -114,3 +105,2 @@ eslintArgs = eslintArgs.concat(files)

parallel([
spawn.bind(undefined, JSHINT, jshintArgs),
spawn.bind(undefined, JSCS, jscsArgs),

@@ -164,3 +154,3 @@ spawn.bind(undefined, ESLINT, eslintArgs)

.sort(function (a, b) {
// sort by line number (merges jshint and jscs output)
// sort by line number (merges output from all linters)
var fileA = FILE_RE.exec(a)[1]

@@ -167,0 +157,0 @@ var fileB = FILE_RE.exec(b)[1]

14

lib/eslint-reporter-verbose.js

@@ -0,1 +1,3 @@

var util = require('util')
module.exports = function (results) {

@@ -7,10 +9,6 @@ var output = ''

messages.forEach(function (message) {
var msg = message.message
output += result.filePath
output += ':' + message.line || 0
output += ':' + message.column || 0
output += ': ' + msg
output += message.ruleId ? ' (' + message.ruleId + ')' : ''
output += '\n'
output += util.format(
'%s:%d:%d: %s (eslint/%s)\n',
result.filePath, message.line || 0, message.column || 0, message.message, message.ruleId
)
})

@@ -17,0 +15,0 @@ })

@@ -0,1 +1,3 @@

var util = require('util')
module.exports = function (results) {

@@ -7,9 +9,6 @@ var output = ''

messages.forEach(function (message) {
var msg = message.message
output += result.filePath
output += ':' + message.line || 0
output += ':' + message.column || 0
output += ': ' + msg
output += '\n'
output += util.format(
'%s:%d:%d: %s\n',
result.filePath, message.line || 0, message.column || 0, message.message
)
})

@@ -16,0 +15,0 @@ })

var util = require('util')
module.exports = function (errorsCollection) {

@@ -9,3 +10,3 @@ errorsCollection.forEach(function (errors) {

console.log(util.format(
'%s:%d:%d: %s (%s)', file, error.line, error.column, message, error.rule
'%s:%d:%d: %s (jscs/%s)', file, error.line, error.column, message, error.rule
))

@@ -12,0 +13,0 @@ })

var util = require('util')
module.exports = function (errorsCollection) {

@@ -3,0 +4,0 @@ errorsCollection.forEach(function (errors) {

{
"name": "standard",
"description": "JavaScript Standard Style",
"version": "2.2.6",
"version": "2.3.0",
"author": {

@@ -21,3 +21,2 @@ "name": "Feross Aboukhadijeh",

"jscs": "^1.10.0",
"jshint": "^2.6.0",
"minimatch": "^2.0.1",

@@ -47,2 +46,4 @@ "minimist": "^1.1.0",

"jshint",
"eslint",
"jscs",
"hint",

@@ -49,0 +50,0 @@ "enforce",

@@ -15,4 +15,12 @@ # JavaScript Standard Style

No decisions to make, no `.jshintrc` or `.jscs` files to manage. It just works.
No decisions to make. No `.eslintrc`, `.jscsrc`, or `.jscsrc` files to manage. It just
works.
This module saves you time in two ways:
- **No configuration.** Just drop it in. The easiest way to enforce consistent style in
your module/project.
- **Catch style errors before they're submitted in PRs.** Saves precious code review time
by eliminating back-and-forth between maintainer and contributor.
## Install

@@ -107,3 +115,3 @@

The beauty of JavaScript Standard Style is that it's simple. No one wants to maintain
multiple hundred-line `.jshintrc` and `.jscs` for every module/project they work on.
multiple hundred-line `.jshintrc` and `.jscsrc` for every module/project they work on.
Enough of this madness!

@@ -146,3 +154,3 @@

JavaScript Standard Style uses [`jshint`](http://jshint.com/) and
JavaScript Standard Style uses [`eslint`](http://eslint.org/) and
[`jscs`](http://jscs.info/) under-the-hood and you can hide their warnings as you normally

@@ -156,8 +164,9 @@ would if you used each linter directly.

Error: Code style check failed:
routes/error.js:20:36: 'next' is defined but never used. (W098)
routes/submit.js:85:2: Expected indentation of 2 characters (validateIndentation)
routes/error.js:20:36: 'file' was used before it was defined. (eslint/no-use-before-define)
routes/submit.js:85:2: Expected indentation of 2 characters (jscs/validateIndentation)
```
The first warning is `jshint` (always starts with a `W`). You can hide it with a
`/* jshint -W098 */` comment. Re-enable with a `/* jshint +W098 */` comment.
The first error is from `eslint`. In this case, the rule name is "no-use-before-define".
You can hide it with a `/*eslint-disable no-use-before-define */` comment. Re-enable with
a `/*eslint-enable no-use-before-define */` comment.

@@ -167,11 +176,9 @@ Example:

```js
/* jshint -W098 */
app.use(function (err, req, res, next) {
res.render('error', { err: err })
})
/* jshint +W098 */
/*eslint-disable no-use-before-define */
// offending code here...
/*eslint-enable no-use-before-define */
```
The second warning is from `jscs` (always a long camel-case string), which you can hide
with a `// jscs:disable validateIndentation` comment. Re-enable with a
The second error is from `jscs`. In this case, the rule name is "validateIndentation".
You can hide it with a `// jscs:disable validateIndentation` comment. Re-enable with a
`// jscs:enable validateIndentation` comment.

@@ -181,3 +188,3 @@

No. Use `jshint` or `jscs` directly if you want that.
No. Use `eslint` or `jscs` directly if you want that.

@@ -184,0 +191,0 @@ Pro tip: Just use `standard` and move on. There are actual real problems that you could

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc