Skip to content
This repository was archived by the owner on Jul 3, 2019. It is now read-only.

Commit a5af7f7

Browse files
authored
Changed: eslint configuration + necessary changes in code. (#137)
1 parent 4a70582 commit a5af7f7

File tree

13 files changed

+95
-214
lines changed

13 files changed

+95
-214
lines changed

.eslintrc

Lines changed: 0 additions & 199 deletions
This file was deleted.

.eslintrc.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
module.exports = {
2+
"extends": "airbnb-base",
3+
"parser": "babel-eslint",
4+
"env": {
5+
"browser": true,
6+
"commonjs": true,
7+
"jasmine": true,
8+
"jest": true,
9+
"es6": true,
10+
},
11+
"rules": {
12+
"arrow-parens": [
13+
"error",
14+
"as-needed",
15+
{ "requireForBlockBody": true }
16+
],
17+
"class-methods-use-this": "off",
18+
"comma-dangle": "off",
19+
"consistent-return": "off",
20+
"func-names": "off",
21+
"import/extensions": "off",
22+
"import/no-extraneous-dependencies": "off",
23+
"import/no-unresolved": [
24+
"error",
25+
{ "ignore": ["handsontable", "walkontable"] }
26+
],
27+
"indent": [
28+
"error",
29+
2,
30+
{
31+
"SwitchCase": 1,
32+
"FunctionDeclaration": { "parameters": "first" },
33+
"FunctionExpression": { "parameters": "first" }
34+
}
35+
],
36+
"max-len": [
37+
"error",
38+
{
39+
"code": 170,
40+
"ignoreComments": true
41+
}
42+
],
43+
"newline-per-chained-call": "off",
44+
"no-constant-condition": [
45+
"error",
46+
{ "checkLoops": false }
47+
],
48+
"no-eq-null": "error",
49+
"no-mixed-operators": [
50+
"error",
51+
{ "groups": [["+", "-", "*", "/", "%", "**"]] }
52+
],
53+
"no-multiple-empty-lines": [
54+
"error",
55+
{ "max": 1 }
56+
],
57+
"no-param-reassign": "off",
58+
"no-plusplus": [
59+
"error",
60+
{ "allowForLoopAfterthoughts": true }
61+
],
62+
"no-restricted-globals": [
63+
"error",
64+
"Handsontable",
65+
{
66+
"name": "console",
67+
"message": "Using the `console` object is not allowed within Handsontable. Please use one of the helpers from the `console.js` file instead."
68+
}
69+
],
70+
"no-underscore-dangle": "off",
71+
"no-use-before-define": [
72+
"error",
73+
{
74+
"functions": false,
75+
"classes": false
76+
}
77+
],
78+
"no-void": "off",
79+
"padded-blocks": "off",
80+
"quotes": [ "error", "single" ],
81+
"space-before-function-paren": ["error", "never"],
82+
},
83+
"overrides": [
84+
{
85+
"files": ["test/**", "src/3rdparty/walkontable/test/**", "*.unit.js", "*.e2e.js", "src/plugins/**/test/helpers/**"],
86+
"rules": {
87+
"no-restricted-globals": "off",
88+
"no-undef": "off",
89+
}
90+
}
91+
],
92+
}

src/plugins/columnSummary/test/columnSummary.e2e.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ describe('ColumnSummarySpec', () => {
3838
tempEndpoint = null;
3939
}
4040

41-
4241
return endpoints;
4342
};
4443

src/plugins/filters/filters.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,6 @@ class Filters extends BasePlugin {
753753
}
754754
}
755755

756-
757756
/**
758757
* Removes specific rows from `hiddenRows` cache for particular column.
759758
*

src/plugins/filters/test/filters.e2e.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
describe('Filters', () => {
23
const id = 'testContainer';
34

src/plugins/filters/test/filtersUI.e2e.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,6 @@ describe('Filters UI', () => {
971971
expect(checkedArray).toEqual([false, true, true]);
972972
});
973973

974-
975974
it('should show proper number of values after refreshing cache ' +
976975
'(should remove the value from component), case nr 2 (changing value to match filtered value)', (done) => {
977976
handsontable({

src/plugins/formulas/test/formulas.e2e.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ describe('Formulas general', () => {
7171
expect(hot.getDataAtCell(0, 1)).toBe('=');
7272
});
7373

74-
7574
it('should calculate table with semicolon as separator of formula arguments', () => {
7675
const data = getDataSimpleExampleFormulas();
7776

src/plugins/ganttChart/test/dateCalculator.unit.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ describe('DateCalculator', () => {
4545
});
4646
});
4747

48-
4948
describe('the `dateToColumn` method', () => {
5049
it('should return a column for a provided date (in string or Date format), when `allowSplitWeeks` is set to true (default)', () => {
5150
const plugin = new DateCalculator({
@@ -94,7 +93,6 @@ describe('DateCalculator', () => {
9493
year: 2017
9594
});
9695

97-
9896
// mock the day cache creation from the actual plugin:
9997
plugin.daysInColumns[2017] = stdCache;
10098

@@ -107,7 +105,6 @@ describe('DateCalculator', () => {
107105
year: 2018
108106
});
109107

110-
111108
// mock the day cache creation from the actual plugin:
112109
plugin.daysInColumns[2017] = stdCache;
113110

src/plugins/ganttChart/test/ganttChart.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
describe('GanttChart', () => {
23
const id = 'testContainer';
34

@@ -132,7 +133,6 @@ describe('GanttChart', () => {
132133
}
133134
});
134135

135-
136136
expect(hot.getCellMeta(0, 1).className.indexOf('rangeBar')).toBeGreaterThan(-1);
137137
expect(hot.getCellMeta(0, 2).className.indexOf('rangeBar')).toBeGreaterThan(-1);
138138
expect(hot.getCellMeta(0, 3).className.indexOf('rangeBar')).toBeGreaterThan(-1);

src/plugins/hiddenColumns/hiddenColumns.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class HiddenColumns extends BasePlugin {
8888
this.lastSelectedColumn = -1;
8989
}
9090

91-
9291
/**
9392
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
9493
* hook and if it returns `true` than the {@link HiddenColumns#enablePlugin} method is called.
@@ -529,7 +528,6 @@ class HiddenColumns extends BasePlugin {
529528
);
530529
}
531530

532-
533531
/**
534532
* `onAfterCreateCol` hook callback.
535533
*
@@ -549,7 +547,6 @@ class HiddenColumns extends BasePlugin {
549547
this.hiddenColumns = tempHidden;
550548
}
551549

552-
553550
/**
554551
* `onAfterRemoveCol` hook callback.
555552
*

0 commit comments

Comments
 (0)