
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@esatterwhite/eslint-config-reasonable
Advanced tools
ESLint config with reasonable comma first settings
eslint config with reasonable comma first settings for node.js projects
> npm install @esatterwhite/eslint-config-reasonable
Add a eslintConfig
block to you package.json
{
"eslintConfig": {
"root": true,
"extends": "@answerbook/eslint-config-reasonable",
"ignorePatterns": [
"node_modules/"
]
}
}
'use strict'
const path = require('path')
const fs = require('fs')
const {promisify} = require('util')
const crypto = require('crypto')
const readFile = promisify(fs.readFile)
const EXP = /\d+/
const SLEEP_MS = 150
const LONG_STRING = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
+ 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
+ 'abcdefghijklmnopqrstuvwxyz'
const OPTIONS = {
FOO: 1
, BAR: 2
, TEST: 'fake'
, LONG: LONG_STRING
}
const isFoo = OPTIONS.FOO
? OPTIONS.BAR
: OPTIONS.TEST
function getOptions() {
return isFoo ? OPTIONS : null
}
function rand(bytes = 10, cb) {
crypto.randomBytes(bytes, (err, buffer) => {
if (err) return cb(err)
cb(null, buffer.toString('hex'))
})
}
async function doWork(opts) {
const {x, y} = opts
try {
const file = await readFile(path.join(x, y))
return file
} catch (err) {
console.error(err)
return null
}
}
;(async () => {
await new Promise((resolve) => {
setTimeout(resolve, SLEEP_MS)
})
console.log('ready', 11 + 33)
})()
function plugin(opts) {
if (this.is_new) {
this.id = Date.now()
} else {
this.updated = new Date()
}
}
module.exports = {
...OPTIONS
, EXP
, rand
, getOptions
, doWork
, plugin
}
FAQs
ESLint config with reasonable comma first settings
We found that @esatterwhite/eslint-config-reasonable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.