Skip to content

Commit 192e242

Browse files
authored
Initial cleanup (#9)
Update linting results to include latest error format for eslint-config-bestpractices. Move eslint warning from index.js to test file. Remove extra directory from linting results.
1 parent bdb726c commit 192e242

File tree

5 files changed

+38
-37
lines changed

5 files changed

+38
-37
lines changed

demo/example.js

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ function ONE_FUNCTION_TO_BRING_THEM_ALL_AND_IN_THE_DARKNESS_BIND_THEM (params) {
2929

3030
const myPromise = new Promise();
3131

32+
/**
33+
* @note
34+
*/
3235
myPromise.then((a) => {
3336
if (true === false) {
3437
return Promise.resolve();

demo/test/snapshots/lint-output.js.md

+32-34
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Generated by [AVA](https://ava.li).
1010
1111
`␊
1212
example.js␊
13-
8:0 error Inline eslint-disable found bestpractices/no-eslint-disable␊
13+
8:0 error Found eslint-disable without " -- comment" bestpractices/no-eslint-disable␊
1414
10:1 warning Unexpected 'FIXME' comment: 'fixMe: Actually make this work' no-warning-comments␊
1515
11:1 warning Unexpected 'TODO' comment: 'todo: Add documentation' no-warning-comments␊
1616
12:1 warning Unexpected 'HACK' comment: 'Hack: Note that these work, regardless...' no-warning-comments␊
@@ -28,36 +28,37 @@ Generated by [AVA](https://ava.li).
2828
25:0 warning Missing JSDoc @returns description jsdoc/require-returns-description␊
2929
25:0 warning Missing JSDoc @returns type jsdoc/require-returns-type␊
3030
30:19 warning Avoid creating new promises promise/avoid-new␊
31-
32:1 warning Expected catch() or return promise/catch-or-return␊
32-
33:3 warning Each then() should return a value or throw promise/always-return␊
33-
33:7 error Unexpected constant condition no-constant-condition␊
34-
34:5 warning Avoid wrapping return values in Promise.resolve promise/no-return-wrap␊
35-
36:5 error 'forgotToDefine' is not defined no-undef␊
36-
40:7 error 'variable' is assigned a value but never used no-unused-vars␊
37-
40:18 warning This conditional operation returns the same value whether the condition is "true" or "false" sonarjs/no-all-duplicated-branches␊
38-
40:18 error Unnecessary use of boolean literals in conditional expression no-unneeded-ternary␊
39-
40:19 error Unexpected constant condition no-constant-condition␊
40-
42:5 warning Correct one of the identical sub-expressions on both sides of operator "&&" sonarjs/no-identical-expressions␊
41-
42:16 warning Unexpected use of undefined no-undefined␊
42-
42:40 warning Unexpected use of undefined no-undefined␊
43-
42:53 error 'params' is not defined no-undef␊
44-
43:3 warning This function expects 1 argument, but 2 were provided sonarjs/no-extra-arguments␊
45-
44:28 error Module path/to/legacyModule is deprecated. Use module x instead deprecate/import␊
46-
46:3 error Function deprecatedFunction is deprecated. Use function x from package y instead deprecate/function␊
47-
46:3 error 'deprecatedFunction' is not defined no-undef␊
48-
48:3 error Member expression $.each is deprecated. Use native forEach instead deprecate/member-expression␊
49-
48:3 error '$' is not defined no-undef␊
50-
50:3 error Unexpected 'debugger' statement no-debugger␊
51-
50:3 error Unreachable code no-unreachable␊
52-
63:10 warning Update this function so that its implementation is not identical to the one on line 55 sonarjs/no-identical-functions␊
53-
71:1 warning Remove this conditional structure or edit its code blocks so that they're not all the same sonarjs/no-all-duplicated-branches␊
54-
71:5 warning {"message":"This always evaluates to truthy. Consider refactoring this code.","secondaryLocations":[]} sonarjs/no-gratuitous-expressions␊
55-
71:5 error Unexpected constant condition no-constant-condition␊
56-
78:1 warning Reduce the number of non-empty switch cases from 11 to at most 10 sonarjs/max-switch-cases␊
57-
82:5 warning Expected a default case default-case␊
58-
82:5 warning Refactor the code to eliminate this nested "switch" sonarjs/no-nested-switch␊
59-
87:7 error This case's code block is the same as the block for the case on line 83 sonarjs/no-duplicated-branches␊
60-
87:7 error Duplicate case label no-duplicate-case␊
31+
33:0 warning Invalid JSDoc tag name "note" jsdoc/check-tag-names␊
32+
35:1 warning Expected catch() or return promise/catch-or-return␊
33+
36:3 warning Each then() should return a value or throw promise/always-return␊
34+
36:7 error Unexpected constant condition no-constant-condition␊
35+
37:5 warning Avoid wrapping return values in Promise.resolve promise/no-return-wrap␊
36+
39:5 error 'forgotToDefine' is not defined no-undef␊
37+
43:7 error 'variable' is assigned a value but never used no-unused-vars␊
38+
43:18 warning This conditional operation returns the same value whether the condition is "true" or "false" sonarjs/no-all-duplicated-branches␊
39+
43:18 error Unnecessary use of boolean literals in conditional expression no-unneeded-ternary␊
40+
43:19 error Unexpected constant condition no-constant-condition␊
41+
45:5 warning Correct one of the identical sub-expressions on both sides of operator "&&" sonarjs/no-identical-expressions␊
42+
45:16 warning Unexpected use of undefined no-undefined␊
43+
45:40 warning Unexpected use of undefined no-undefined␊
44+
45:53 error 'params' is not defined no-undef␊
45+
46:3 warning This function expects 1 argument, but 2 were provided sonarjs/no-extra-arguments␊
46+
47:28 error Module path/to/legacyModule is deprecated. Use module x instead deprecate/import␊
47+
49:3 error Function deprecatedFunction is deprecated. Use function x from package y instead deprecate/function␊
48+
49:3 error 'deprecatedFunction' is not defined no-undef␊
49+
51:3 error Member expression $.each is deprecated. Use native forEach instead deprecate/member-expression␊
50+
51:3 error '$' is not defined no-undef␊
51+
53:3 error Unexpected 'debugger' statement no-debugger␊
52+
53:3 error Unreachable code no-unreachable␊
53+
66:10 warning Update this function so that its implementation is not identical to the one on line 58 sonarjs/no-identical-functions␊
54+
74:1 warning Remove this conditional structure or edit its code blocks so that they're not all the same sonarjs/no-all-duplicated-branches␊
55+
74:5 warning {"message":"This always evaluates to truthy. Consider refactoring this code.","secondaryLocations":[]} sonarjs/no-gratuitous-expressions␊
56+
74:5 error Unexpected constant condition no-constant-condition␊
57+
81:1 warning Reduce the number of non-empty switch cases from 11 to at most 10 sonarjs/max-switch-cases␊
58+
85:5 warning Expected a default case default-case␊
59+
85:5 warning Refactor the code to eliminate this nested "switch" sonarjs/no-nested-switch␊
60+
90:7 error This case's code block is the same as the block for the case on line 86 sonarjs/no-duplicated-branches␊
61+
90:7 error Duplicate case label no-duplicate-case␊
6162
6263
example.json␊
6364
4:6 error Property keys must be doublequoted json/undefined␊
@@ -75,9 +76,6 @@ Generated by [AVA](https://ava.li).
7576
test/lint-output.js␊
7677
12:7 warning Unexpected console statement no-console␊
7778
78-
/Users/clif/sandbox/frontier/common/eslint-config-tree/index.js␊
79-
52:0 warning Invalid JSDoc tag name "note" jsdoc/check-tag-names␊
80-
8179
✖ 59 problems (25 errors, 34 warnings)␊
8280
0 errors and 2 warnings potentially fixable with the `--fix` option.␊
8381
`
-39 Bytes
Binary file not shown.

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = {
4949
parser: 'babel-eslint',
5050
/**
5151
* @property {object} plugins - Tree additional linter plugins.
52-
* @note - Code Climate does not yet support bestpractices, deprecate, no-only-tests, no-skip-tests, sonarjs, and test-selectors, and breaks if they are present. You will need to add these plugins individually in your .eslintrc.js file. The first time you add a file, Code Climate will complain about not being able to find the definitions for these extra rules once for every new file. Obnoxious, but the best we have, for now.
52+
Code Climate does not yet support bestpractices, deprecate, no-only-tests, no-skip-tests, sonarjs, and test-selectors, and breaks if they are present. You will need to add these plugins individually in your .eslintrc.js file. The first time you add a file, Code Climate will complain about not being able to find the definitions for these extra rules once for every new file. Obnoxious, but the best we have, for now.
5353
*/
5454
plugins: [
5555
// 'eslint-plugin-bestpractices',

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-tree",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "Shared Tree configuration that contains overrides and enhancements on top of the base frontier configuration.",
55
"main": "index.js",
66
"repository": {
@@ -60,7 +60,7 @@
6060
"preinstall": "git config --global url.https://github.com/.insteadOf git://github.com/",
6161
"postinstall": "npm rebuild husky",
6262
"test": "npm run lint:snapshot; ava",
63-
"test:format": "sed -i '' 's|^.*eslint-config-tree/demo/||g' demo/test/snapshots/new-lint-results.txt",
63+
"test:format": "sed -i '' 's|^.*/demo/||g' demo/test/snapshots/new-lint-results.txt",
6464
"test:update": "npm run lint:snapshot; ava --update-snapshots"
6565
}
6666
}

0 commit comments

Comments
 (0)