eslint-config-logdna
Advanced tools
Comparing version 3.1.0 to 4.0.0
@@ -0,1 +1,9 @@ | ||
# 2020-12-04, Version 4.0.0 (Stable) | ||
* [[deb2012c76](https://github.com/logdna/eslint-config-logdna/commit/deb2012c76)] - **(SEMVER-MAJOR)** feat(rules)!: func-style disallows function expressions (Darin Spivey) [LOG-8207](https://logdna.atlassian.net/browse/LOG-8207) | ||
* [[1f665218c7](https://github.com/logdna/eslint-config-logdna/commit/1f665218c7)] - feat(test): Fix JUnit file so CI can report errors (Darin Spivey) | ||
* [[6f8bcc12ea](https://github.com/logdna/eslint-config-logdna/commit/6f8bcc12ea)] - **(SEMVER-MINOR)** feat(rules): arrow-body-style enforces braces around arrow functions (Darin Spivey) [LOG-8207](https://logdna.atlassian.net/browse/LOG-8207) | ||
* [[f14276f30e](https://github.com/logdna/eslint-config-logdna/commit/f14276f30e)] - **(SEMVER-MINOR)** feat(rules): arrow-parens are always required (Darin Spivey) [LOG-8207](https://logdna.atlassian.net/browse/LOG-8207) | ||
* [[f912dc11d0](https://github.com/logdna/eslint-config-logdna/commit/f912dc11d0)] - chore: Put test fixtures in one directory (Darin Spivey) [LOG-8207](https://logdna.atlassian.net/browse/LOG-8207) | ||
# 2020-11-18, Version 3.1.0 (Stable) | ||
@@ -2,0 +10,0 @@ |
@@ -26,5 +26,4 @@ { | ||
"array-callback-return": 2, | ||
"arrow-parens": ["error", "as-needed", { | ||
"requireForBlockBody": true | ||
}], | ||
"arrow-body-style": ["error", "always"], | ||
"arrow-parens": ["error", "always"], | ||
"block-scoped-var": 2, | ||
@@ -55,2 +54,3 @@ "block-spacing": [2, "always"], | ||
"eqeqeq": [2, "allow-null"], | ||
"func-style": ["error", "declaration"], | ||
"handle-callback-err": [2, "^(error|err|er)"], | ||
@@ -226,3 +226,2 @@ "guard-for-in": 2, | ||
"yoda": 0, | ||
"sensible/check-require": [2, "always"], | ||
"logdna/grouped-require": 2, | ||
@@ -243,4 +242,5 @@ "logdna/require-file-extension": 2, | ||
} | ||
}] | ||
}], | ||
"sensible/check-require": [2, "always"] | ||
} | ||
} |
{ | ||
"name": "eslint-config-logdna", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"description": "LogDNA's preferred eslint config to be used across all projects", | ||
@@ -8,5 +8,4 @@ "main": "index.js", | ||
"lint": "eslint ./", | ||
"tap": "tap", | ||
"pretest": "npm run lint", | ||
"test": "tap" | ||
"test": "tools/test.sh" | ||
}, | ||
@@ -42,3 +41,4 @@ "eslintConfig": { | ||
"eslint": "^7.9.0", | ||
"tap": "^14.10.7" | ||
"tap": "^14.10.7", | ||
"tap-xunit": "^2.4.1" | ||
}, | ||
@@ -45,0 +45,0 @@ "dependencies": { |
@@ -8,7 +8,7 @@ 'use strict' | ||
const {CLIEngine} = require('eslint') | ||
const CODE = path.join(__dirname, 'fixture') | ||
const VALID_CODE = path.join(__dirname, 'fixtures', 'valid-code') | ||
const readFile = promisify(fs.readFile) | ||
test('valid config', async (t) => { | ||
const code = await readFile(CODE, 'utf8') | ||
const code = await readFile(VALID_CODE, 'utf8') | ||
const cli = new CLIEngine({ | ||
@@ -15,0 +15,0 @@ useEslintrc: false |
@@ -12,3 +12,3 @@ 'use strict' | ||
const readFile = fs.promises.readFile | ||
test('invalid config', async (t) => { | ||
test('Invalid linting for larger code blocks read from fixtures', async (t) => { | ||
const cli = new CLIEngine({ | ||
@@ -72,1 +72,60 @@ useEslintrc: false | ||
}).catch(threw) | ||
test('Invlalid linting with quick-and-dirty inline code', async (t) => { | ||
const cli = new CLIEngine({ | ||
useEslintrc: false | ||
, cwd: __dirname | ||
, configFile: '../eslintrc.json' | ||
, rules: { | ||
'strict': 'off' | ||
, 'sensible/indent': 'off' | ||
, 'eol-last': 'off' | ||
, 'no-unused-vars': 'off' | ||
} | ||
}) | ||
t.test('arrow-parens', async (t) => { | ||
const code = '[].map(thing => { return thing + 1 })' | ||
const result = cli.executeOnText(code) | ||
t.equal(result.errorCount, 1, 'error count') | ||
const messages = result.results[0].messages | ||
t.equal(messages[0].ruleId, 'arrow-parens', 'arrow-parens is the rule id') | ||
t.equal( | ||
messages[0].message | ||
, 'Expected parentheses around arrow function argument.' | ||
, 'Error message is correct' | ||
) | ||
}) | ||
t.test('arrow-body-style', async (t) => { | ||
const code = '[].map((thing) => thing + 1)' | ||
const result = cli.executeOnText(code) | ||
t.equal(result.errorCount, 1, 'error count') | ||
const messages = result.results[0].messages | ||
t.equal(messages[0].ruleId, 'arrow-body-style', 'arrow-body-style is the rule id') | ||
t.equal( | ||
messages[0].message | ||
, 'Expected block statement surrounding arrow body.' | ||
, 'Error message is correct' | ||
) | ||
}) | ||
t.test('func-style', async (t) => { | ||
const code = 'const NOOP = () => {}' | ||
const result = cli.executeOnText(code) | ||
t.equal(result.errorCount, 1, 'error count') | ||
const messages = result.results[0].messages | ||
t.equal(messages[0].ruleId, 'func-style', 'func-style is the rule id') | ||
t.equal( | ||
messages[0].message | ||
, 'Expected a function declaration.' | ||
, 'Error message is correct' | ||
) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
18728
382
3