eslint-config-hapi
Advanced tools
Comparing version 3.0.2 to 4.0.0
139
lib/index.js
@@ -0,72 +1,71 @@ | ||
'use strict'; | ||
module.exports = { | ||
plugins: ['eslint-plugin-hapi'], | ||
env: { | ||
node: true, | ||
es6: true | ||
}, | ||
rules: { | ||
'camelcase': 0, | ||
'consistent-return': 0, | ||
'vars-on-top': 0, | ||
'one-var': 0, | ||
'strict': 0, | ||
'new-cap': 0, | ||
'no-console': 0, | ||
'no-constant-condition': 0, | ||
'no-empty': 0, | ||
'no-native-reassign': 0, | ||
'no-underscore-dangle': 0, | ||
'no-undef': 0, | ||
'no-process-exit': 0, | ||
'no-use-before-define': 0, | ||
'no-unused-expressions': 0, | ||
'no-regex-spaces': 0, | ||
'no-catch-shadow': 0, | ||
'strict': 0, | ||
'handle-callback-err': 0, | ||
'no-lonely-if': 0, | ||
'brace-style': 0, | ||
'no-shadow': 0, | ||
'no-unused-vars': [1, { vars: 'all', varsIgnorePattern: '^internals$', 'args': 'none' }], | ||
'hapi/no-shadow-relaxed': [1, { 'ignore': ['err', 'done'] }], | ||
'hapi/hapi-capitalize-modules': [1, 'global-scope-only'], | ||
'hapi/hapi-scope-start': 1, | ||
'array-bracket-spacing': 1, | ||
'dot-notation': 1, | ||
'eol-last': 1, | ||
'no-trailing-spaces': 1, | ||
'no-eq-null': 1, | ||
'no-extend-native': 1, | ||
'no-redeclare': 1, | ||
'no-loop-func': 1, | ||
'yoda': [1, 'never'], | ||
'sort-vars': 1, | ||
'quotes': [2, 'single'], | ||
'consistent-this': [2, 'self'], | ||
'func-style': [2, 'expression'], | ||
'new-parens': 2, | ||
'no-array-constructor': 2, | ||
'no-new-object': 2, | ||
'no-spaced-func': 2, | ||
'no-mixed-spaces-and-tabs': 2, | ||
'space-after-keywords': 2, | ||
'semi': [2, 'always'], | ||
'semi-spacing': [2, { 'before': false, 'after': true }], | ||
'space-infix-ops': 2, | ||
'space-return-throw-case': 2, | ||
'space-unary-ops': [1, { 'words': true, 'nonwords': false }], | ||
'eqeqeq': 2, | ||
'curly': [2, 'all'], | ||
'no-eval': 2, | ||
'no-else-return': 2, | ||
'no-return-assign': 2, | ||
'no-new-wrappers': 2, | ||
'comma-dangle': [2, 'never'], | ||
'no-sparse-arrays': 2, | ||
'no-ex-assign': 2, | ||
'indent': [2, 4, { 'SwitchCase': 1 }], | ||
'space-before-function-paren': 2, | ||
'func-style': [2, 'expression'], | ||
'object-curly-spacing': [2, 'always'] | ||
} | ||
plugins: ['eslint-plugin-hapi'], | ||
env: { | ||
node: true, | ||
es6: true | ||
}, | ||
rules: { | ||
'camelcase': 0, | ||
'consistent-return': 0, | ||
'vars-on-top': 0, | ||
'one-var': 0, | ||
'new-cap': 0, | ||
'no-console': 0, | ||
'no-constant-condition': 0, | ||
'no-empty': 0, | ||
'no-native-reassign': 0, | ||
'no-underscore-dangle': 0, | ||
'no-undef': 0, | ||
'no-process-exit': 0, | ||
'no-use-before-define': 0, | ||
'no-unused-expressions': 0, | ||
'no-regex-spaces': 0, | ||
'no-catch-shadow': 0, | ||
'strict': 0, | ||
'handle-callback-err': 0, | ||
'no-lonely-if': 0, | ||
'no-shadow': 0, | ||
'brace-style': [1, 'stroustrup'], | ||
'no-unused-vars': [1, { vars: 'all', varsIgnorePattern: '^internals$', 'args': 'none' }], | ||
'hapi/no-shadow-relaxed': [1, { 'ignore': ['err', 'done'] }], | ||
'hapi/hapi-capitalize-modules': [1, 'global-scope-only'], | ||
'hapi/hapi-scope-start': 1, | ||
'array-bracket-spacing': 1, | ||
'dot-notation': 1, | ||
'eol-last': 1, | ||
'no-trailing-spaces': 1, | ||
'no-eq-null': 1, | ||
'no-extend-native': 1, | ||
'no-redeclare': 1, | ||
'no-loop-func': 1, | ||
'yoda': [1, 'never'], | ||
'sort-vars': 1, | ||
'quotes': [2, 'single'], | ||
'consistent-this': [2, 'self'], | ||
'new-parens': 2, | ||
'no-array-constructor': 2, | ||
'no-new-object': 2, | ||
'no-spaced-func': 2, | ||
'no-mixed-spaces-and-tabs': 2, | ||
'space-after-keywords': 2, | ||
'semi': [2, 'always'], | ||
'semi-spacing': [2, { 'before': false, 'after': true }], | ||
'space-infix-ops': 2, | ||
'space-return-throw-case': 2, | ||
'space-unary-ops': [1, { 'words': true, 'nonwords': false }], | ||
'eqeqeq': 2, | ||
'curly': [2, 'all'], | ||
'no-eval': 2, | ||
'no-else-return': 2, | ||
'no-return-assign': 2, | ||
'no-new-wrappers': 2, | ||
'comma-dangle': [2, 'never'], | ||
'no-sparse-arrays': 2, | ||
'no-ex-assign': 2, | ||
'indent': [2, 4, { 'SwitchCase': 1 }], | ||
'space-before-function-paren': 2, | ||
'func-style': [2, 'expression'], | ||
'object-curly-spacing': [2, 'always'] | ||
} | ||
}; |
{ | ||
"name": "eslint-config-hapi", | ||
"version": "3.0.2", | ||
"version": "4.0.0", | ||
"description": "Shareable ESLint config for the hapi ecosystem", | ||
@@ -17,3 +17,4 @@ "author": "Continuation Labs <contact@continuation.io> (http://continuation.io/)", | ||
"scripts": { | ||
"test": "lab -v -t 100 -a code" | ||
"lint": "belly-button -I 'node_modules/**' -I 'test/fixtures/**'", | ||
"test": "npm run lint && lab -v -t 100 -a code" | ||
}, | ||
@@ -24,2 +25,3 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"belly-button": "1.x.x", | ||
"code": "1.x.x", | ||
@@ -26,0 +28,0 @@ "eslint": "1.x.x", |
@@ -18,3 +18,3 @@ 'use strict'; | ||
function getLinter() { | ||
function getLinter () { | ||
return new CLIEngine({ | ||
@@ -26,3 +26,3 @@ useEslintrc: false, | ||
function lintFile(file) { | ||
function lintFile (file) { | ||
var cli = getLinter(); | ||
@@ -34,3 +34,3 @@ var data = Fs.readFileSync(Path.join(__dirname, file), 'utf8'); | ||
function lintString(str) { | ||
function lintString (str) { | ||
var cli = getLinter(); | ||
@@ -42,2 +42,23 @@ | ||
describe('eslint-config-hapi', function () { | ||
it('enforces stroustrup style braces', function (done) { | ||
var output = lintFile('fixtures/brace-style.js'); | ||
var results = output.results[0]; | ||
expect(output.errorCount).to.equal(0); | ||
expect(output.warningCount).to.equal(1); | ||
expect(results.errorCount).to.equal(0); | ||
expect(results.warningCount).to.equal(1); | ||
var msg = results.messages[0]; | ||
expect(msg.ruleId).to.equal('brace-style'); | ||
expect(msg.severity).to.equal(1); | ||
expect(msg.message).to.equal('Closing curly brace appears on the same line as the subsequent block.'); | ||
expect(msg.line).to.equal(6); | ||
expect(msg.column).to.equal(8); | ||
expect(msg.nodeType).to.equal('BlockStatement'); | ||
expect(msg.source).to.equal('} else {'); | ||
done(); | ||
}); | ||
it('enforces four space indentation', function (done) { | ||
@@ -44,0 +65,0 @@ var output = lintFile('fixtures/indent.js'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16045
16
361
5