eslint-config-uphold 1.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,184 +0,0 @@
1
- // Avoid extra `no-unused-vars` violations.
2
- function noop() {
3
- // do nothing
4
- }
5
-
6
- // `consistent-this`.
7
- const consistentThis = this;
8
-
9
- noop(consistentThis);
10
-
11
- // `curly`.
12
- let curly = true;
13
-
14
- if (curly) curly = false;
15
-
16
- // `dot-notation`.
17
- const dotNotation = {};
18
-
19
- dotNotation['foo'] = 'bar';
20
-
21
- // `id-match`.
22
- let id_mátch;
23
-
24
- noop(id_mátch);
25
-
26
- // `mocha/no-exclusive-tests`.
27
- describe.only('noExclusiveTests', () => {
28
- it('should not work');
29
- });
30
-
31
- // `mocha/no-identical-title`.
32
- describe('noIdenticalTitle', () => {
33
- it('should not work');
34
- it('should not work');
35
- });
36
-
37
- // `mocha/no-nested-tests`.
38
- it('noNestedTests', () => {
39
- it('should not work');
40
- });
41
-
42
- // `mocha/no-sibling-hooks`.
43
- describe('noSiblingHooks', () => {
44
- before(() => {});
45
- before(() => {});
46
- });
47
-
48
- // `new-cap`.
49
- const cap = require('cap');
50
-
51
- new cap();
52
-
53
- // `no-class-assign`.
54
- class NoClassAssign {}
55
-
56
- NoClassAssign = 'foobar';
57
-
58
- noop(NoClassAssign);
59
-
60
- // `no-const-assign`.
61
- const noConstAssign = true;
62
-
63
- noConstAssign = false;
64
-
65
- noop(noConstAssign);
66
-
67
- // `no-constant-condition`.
68
- if (true) {
69
- noop(true);
70
- }
71
-
72
- // `no-dupe-class-members`.
73
- class NoDupeClassMembers {
74
- foo() {
75
- return 'bar';
76
- }
77
-
78
- foo() {
79
- return 'foo';
80
- }
81
- }
82
-
83
- noop(NoDupeClassMembers);
84
-
85
- // `no-labels`.
86
- noLabels: {
87
- break noLabels;
88
- }
89
-
90
- // `no-multi-str`.
91
- const noMultiStr = 'Line 1 \
92
- Line 2';
93
-
94
- noop(noMultiStr);
95
-
96
- // `no-this-before-super`.
97
- const NoThisBeforeSuper = require('no-this-before-super');
98
-
99
- class Child extends NoThisBeforeSuper {
100
- constructor() {
101
- this.foo = 'bar';
102
- super();
103
- }
104
- }
105
-
106
- noop(Child);
107
-
108
- // `no-underscore-dangle`.
109
- class NoUnderscoreDangle {
110
- constructor() {
111
- this._foo();
112
- }
113
- }
114
-
115
- noop(new NoUnderscoreDangle());
116
-
117
- // `no-unused-vars`
118
- const foobar = '';
119
-
120
- // `padding-line-between-statements`.
121
- const newLineAfterVar = 'foo';
122
- noop(newLineAfterVar);
123
-
124
- function funcThatReturns(bar) {
125
- if (!bar) {
126
- return;
127
- }
128
- return bar;
129
- }
130
-
131
- funcThatReturns('foo');
132
-
133
- // `prefer-destructuring`.
134
- const bar = {};
135
- const biz = bar.biz;
136
- const baz = biz[0];
137
-
138
- noop(biz, baz);
139
-
140
- // `prettier/prettier`.
141
- const singleQuote = "true";
142
-
143
- noop(singleQuote);
144
-
145
- const maximumLineLength = 'prettier dictates that lines of code must not exceed a length limit of 120 characters maximum';
146
-
147
- noop(maximumLineLength);
148
-
149
- // `require-await`.
150
- (async () => {})();
151
-
152
- // `sort-imports`.
153
- import import1 from 'import-1';
154
- import { import2 } from 'import-2';
155
-
156
- noop(import1);
157
- noop(import2);
158
-
159
- // `sort-keys`.
160
- const sortObjectProps = {
161
- var1: 'foo',
162
- var10: 'bar',
163
- var9: 'biz'
164
- };
165
-
166
- noop(sortObjectProps);
167
-
168
- // `spaced-comment`.
169
- //Comment missing space.
170
-
171
- // `sql-template/no-unsafe-query`.
172
- const db = {
173
- query: noop()
174
- };
175
- const foo = 'foo';
176
-
177
- db.query(`SELECT ${foo} FROM bar`);
178
-
179
- // `yoda`.
180
- let yoda = true;
181
-
182
- if (true === yoda) {
183
- yoda = false;
184
- }
package/test/index.js DELETED
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Module dependencies.
5
- */
6
-
7
- const { CLIEngine } = require('eslint');
8
- const path = require('path');
9
-
10
- /**
11
- * Tests for `eslint-config-uphold`.
12
- */
13
-
14
- describe('eslint-config-uphold', () => {
15
- const linter = new CLIEngine({ configFile: path.join(__dirname, '..', 'src', 'index.js') });
16
-
17
- it('should not generate any violation for correct code', () => {
18
- const source = path.join(__dirname, 'fixtures', 'correct.js');
19
-
20
- linter.executeOnFiles([source]).results[0].messages.should.be.empty();
21
- });
22
-
23
- it('should generate violations for incorrect code', () => {
24
- const source = path.join(__dirname, 'fixtures', 'incorrect.js');
25
-
26
- Array.from(linter.executeOnFiles([source]).results[0].messages.map(violation => violation.ruleId)).should.eql([
27
- 'consistent-this',
28
- 'curly',
29
- 'dot-notation',
30
- 'id-match',
31
- 'mocha/no-exclusive-tests',
32
- 'mocha/no-identical-title',
33
- 'mocha/no-nested-tests',
34
- 'mocha/no-sibling-hooks',
35
- 'no-new',
36
- 'new-cap',
37
- 'no-class-assign',
38
- 'no-const-assign',
39
- 'no-constant-condition',
40
- 'no-dupe-class-members',
41
- 'no-labels',
42
- 'no-labels',
43
- 'no-multi-str',
44
- 'no-this-before-super',
45
- 'no-underscore-dangle',
46
- 'no-unused-vars',
47
- 'padding-line-between-statements',
48
- 'padding-line-between-statements',
49
- 'prefer-destructuring',
50
- 'prefer-destructuring',
51
- 'prettier/prettier',
52
- 'prettier/prettier',
53
- 'sort-imports-es6/sort-imports-es6',
54
- 'sort-keys',
55
- 'spaced-comment',
56
- 'sql-template/no-unsafe-query',
57
- 'yoda'
58
- ]);
59
- });
60
- });