Remove extra-lint
- standard enforces 'let' and 'const' now - I've never been a fan of the <100 chars per line rule since it violates the standard philosophy. it should be possible to write conformant code without needing a tool, so 'magic numbers' like 'no more than X lines/chars/statements' are not ideal
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const walkSync = require('walk-sync')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
let hasErrors = false
|
||||
|
||||
// Find all Javascript source files
|
||||
const files = walkSync('src', { globs: ['**/*.js'] })
|
||||
console.log('Running extra-lint on ' + files.length + ' files...')
|
||||
|
||||
// Read each file, line by line
|
||||
files.forEach(function (file) {
|
||||
const filepath = path.join('src', file)
|
||||
const lines = fs.readFileSync(filepath, 'utf8').split('\n')
|
||||
|
||||
lines.forEach(function (line, i) {
|
||||
let error
|
||||
|
||||
// No lines over 100 characters
|
||||
if (line.length > 100) {
|
||||
error = 'Line >100 chars'
|
||||
}
|
||||
|
||||
if (line.match(/^var /) || line.match(/ var /)) {
|
||||
error = 'Use const or let'
|
||||
}
|
||||
|
||||
if (error) {
|
||||
const name = path.basename(file)
|
||||
console.log('%s:%d - %s:\n%s', name, i + 1, error, line)
|
||||
hasErrors = true
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
if (hasErrors) process.exit(1)
|
||||
else console.log('Looks good!')
|
||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -3969,12 +3969,6 @@
|
||||
"ansi-colors": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"ensure-posix-path": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ensure-posix-path/-/ensure-posix-path-1.1.1.tgz",
|
||||
"integrity": "sha512-VWU0/zXzVbeJNXvME/5EmLuEj2TauvoaTz6aFYK1Z92JCBlDlZ3Gu0tuGR42kpW1754ywTs+QB0g5TP0oj9Zaw==",
|
||||
"dev": true
|
||||
},
|
||||
"err-code": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
|
||||
@@ -7325,16 +7319,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"matcher-collection": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-2.0.1.tgz",
|
||||
"integrity": "sha512-daE62nS2ZQsDg9raM0IlZzLmI2u+7ZapXBwdoeBUKAYERPDDIc0qNqA8E0Rp2D+gspKR7BgIFP52GeujaGXWeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"minimatch": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"material-ui": {
|
||||
"version": "0.20.2",
|
||||
"resolved": "https://registry.npmjs.org/material-ui/-/material-ui-0.20.2.tgz",
|
||||
@@ -11415,18 +11399,6 @@
|
||||
"he": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"walk-sync": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-2.2.0.tgz",
|
||||
"integrity": "sha512-IC8sL7aB4/ZgFcGI2T1LczZeFWZ06b3zoHH7jBPyHxOtIIz1jppWHjjEXkOFvFojBVAK9pV7g47xOZ4LW3QLfg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"ensure-posix-path": "^1.1.0",
|
||||
"matcher-collection": "^2.0.0",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"warning": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz",
|
||||
|
||||
@@ -77,8 +77,7 @@
|
||||
"run-series": "^1.1.9",
|
||||
"spectron": "~12.0.0",
|
||||
"standard": "*",
|
||||
"tape": "^5.0.1",
|
||||
"walk-sync": "^2.2.0"
|
||||
"tape": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
@@ -115,7 +114,7 @@
|
||||
"open-config": "node ./bin/open-config.js",
|
||||
"package": "node ./bin/package.js",
|
||||
"start": "npm run build && electron --no-sandbox .",
|
||||
"test": "standard && depcheck --ignores=standard,@babel/eslint-parser --ignore-dirs=build,dist && node ./bin/extra-lint.js",
|
||||
"test": "standard && depcheck --ignores=standard,@babel/eslint-parser --ignore-dirs=build,dist",
|
||||
"test-integration": "npm run build && node ./test",
|
||||
"update-authors": "./bin/update-authors.sh",
|
||||
"watch": "nodemon --exec \"npm run start\" --ext js,css --ignore build/ --ignore dist/"
|
||||
|
||||
Reference in New Issue
Block a user