Skip to content

Commit f3ff718

Browse files
Fix lint errors in jQuery project
1 parent ee5c3c4 commit f3ff718

File tree

9 files changed

+151
-156
lines changed

9 files changed

+151
-156
lines changed

jQuery/.prettierrc.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"tabWidth": 2,
3-
"htmlWhitespaceSensitivity": "strict",
4-
"printWidth": 200,
5-
"overrides": []
2+
"tabWidth": 2,
3+
"htmlWhitespaceSensitivity": "strict",
4+
"printWidth": 200,
5+
"overrides": []
66
}

jQuery/.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "eslint-config-devextreme/stylelintrc"
2+
"extends": "eslint-config-devextreme/stylelintrc"
33
}

jQuery/.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"editor.codeActionsOnSave": {
3-
"source.fixAll.eslint": true
4-
}
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": true
4+
}
55
}

jQuery/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ npm install
1010

1111
## Code
1212

13-
Take a look at the following files of this example to see the required code:
13+
Take a look at the following files of this example to see the required code:
1414

1515
Your files go here
1616

1717
## Development server
1818

1919
Run the `npm run start` command to run the development server. Use the following link to check the example:
20+
2021
```
2122
http://localhost:3000/src/index.html
2223
```
@@ -26,5 +27,3 @@ http://localhost:3000/src/index.html
2627
You can learn more about jQuery API in the [jQuery documentation](https://api.jquery.com/).
2728

2829
To get more help on DevExtreme submit an issue on [GitHub](https://github.com/DevExpress/devextreme/issues) or [Support Center](https://www.devexpress.com/Support/Center/Question/Create)
29-
30-

jQuery/bs-config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"port": 5050,
3-
"startPath": "src/index.html",
4-
"files": ["./src/**/*.{html,css,js}"]
2+
"port": 5050,
3+
"startPath": "src/index.html",
4+
"files": ["./src/**/*.{html,css,js}"]
55
}

jQuery/index.html

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
<!DOCTYPE html>
2-
<html>
3-
4-
<head>
5-
<meta charset="utf-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
9-
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.js"></script>
10-
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/19.2.11/css/dx.common.css">
11-
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/19.2.11/css/dx.light.css">
12-
<script type="text/javascript" src="https://cdn3.devexpress.com/jslib/19.2.11/js/dx.all.js"></script>
13-
14-
<script type="text/javascript" src="script.js"></script>
15-
</head>
16-
17-
<body class="dx-viewport">
18-
<div id="gridContainer"></div>
19-
</body>
20-
21-
</html>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
8+
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.1.js"></script>
9+
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/19.2.11/css/dx.common.css" />
10+
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/19.2.11/css/dx.light.css" />
11+
<script type="text/javascript" src="https://cdn3.devexpress.com/jslib/19.2.11/js/dx.all.js"></script>
12+
13+
<script type="text/javascript" src="script.js"></script>
14+
</head>
15+
16+
<body class="dx-viewport">
17+
<div id="gridContainer"></div>
18+
</body>
19+
</html>

jQuery/script.js

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,68 @@
1-
$(function () {
2-
3-
var employees = [{
4-
"ID": 1,
5-
"FirstName": "John",
6-
"LastName": "Heart",
7-
"City": "Los Angeles"
8-
}, {
9-
"ID": 2,
10-
"FirstName": "Olivia",
11-
"LastName": "Peyton",
12-
"City": "Los Angeles"
13-
}, {
14-
"ID": 3,
15-
"FirstName": "Robert",
16-
"LastName": "Reagan",
17-
"City": "Bentonville"
18-
}, {
19-
"ID": 4,
20-
"FirstName": "Greta",
21-
"LastName": "Sims",
22-
"City": "Boise"
23-
}, {
24-
"ID": 5,
25-
"FirstName": "Brett",
26-
"LastName": "Wade",
27-
"City": "Atlanta"
28-
}];
29-
30-
$("#gridContainer").dxDataGrid({
31-
dataSource: employees,
32-
columns: ['FirstName', 'LastName', 'Title', 'City', 'Country'],
33-
paging: {
34-
pageSize: 10
35-
},
36-
pager: {
37-
showPageSizeSelector: true,
38-
allowedPageSizes: [5, 10, 20]
39-
},
40-
editing: {
41-
mode: "row",
42-
allowUpdating: true,
43-
allowDeleting: true,
44-
allowAdding: true
45-
},
46-
onContextMenuPreparing: function (e) {
47-
if (e.row.rowType === "data") {
48-
e.items = [{
49-
text: "edit",
50-
onItemClick: function () {
51-
e.component.editRow(e.row.rowIndex);
52-
}
53-
},
54-
{
55-
text: "insert",
56-
onItemClick: function () {
57-
e.component.addRow();
58-
}
59-
},
60-
{
61-
text: "delete",
62-
onItemClick: function () {
63-
e.component.deleteRow(e.row.rowIndex);
64-
}
65-
}];
66-
}
67-
}
68-
});
69-
});
1+
$(() => {
2+
const employees = [{
3+
'ID': 1,
4+
'FirstName': 'John',
5+
'LastName': 'Heart',
6+
'City': 'Los Angeles',
7+
}, {
8+
'ID': 2,
9+
'FirstName': 'Olivia',
10+
'LastName': 'Peyton',
11+
'City': 'Los Angeles',
12+
}, {
13+
'ID': 3,
14+
'FirstName': 'Robert',
15+
'LastName': 'Reagan',
16+
'City': 'Bentonville',
17+
}, {
18+
'ID': 4,
19+
'FirstName': 'Greta',
20+
'LastName': 'Sims',
21+
'City': 'Boise',
22+
}, {
23+
'ID': 5,
24+
'FirstName': 'Brett',
25+
'LastName': 'Wade',
26+
'City': 'Atlanta',
27+
}];
28+
29+
$('#gridContainer').dxDataGrid({
30+
dataSource: employees,
31+
columns: ['FirstName', 'LastName', 'Title', 'City', 'Country'],
32+
paging: {
33+
pageSize: 10,
34+
},
35+
pager: {
36+
showPageSizeSelector: true,
37+
allowedPageSizes: [5, 10, 20],
38+
},
39+
editing: {
40+
mode: 'row',
41+
allowUpdating: true,
42+
allowDeleting: true,
43+
allowAdding: true,
44+
},
45+
onContextMenuPreparing(e) {
46+
if (e.row.rowType === 'data') {
47+
e.items = [{
48+
text: 'edit',
49+
onItemClick() {
50+
e.component.editRow(e.row.rowIndex);
51+
},
52+
},
53+
{
54+
text: 'insert',
55+
onItemClick() {
56+
e.component.addRow();
57+
},
58+
},
59+
{
60+
text: 'delete',
61+
onItemClick() {
62+
e.component.deleteRow(e.row.rowIndex);
63+
},
64+
}];
65+
}
66+
},
67+
});
68+
});

jQuery/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
<div id="gridContainer"></div>
1919
</div>
2020
</body>
21-
</html>
21+
</html>

jQuery/src/index.js

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,68 @@
1-
$(()=>{
2-
3-
var employees = [{
4-
"ID": 1,
5-
"FirstName": "John",
6-
"LastName": "Heart",
7-
"City": "Los Angeles"
1+
$(() => {
2+
const employees = [{
3+
'ID': 1,
4+
'FirstName': 'John',
5+
'LastName': 'Heart',
6+
'City': 'Los Angeles',
87
}, {
9-
"ID": 2,
10-
"FirstName": "Olivia",
11-
"LastName": "Peyton",
12-
"City": "Los Angeles"
8+
'ID': 2,
9+
'FirstName': 'Olivia',
10+
'LastName': 'Peyton',
11+
'City': 'Los Angeles',
1312
}, {
14-
"ID": 3,
15-
"FirstName": "Robert",
16-
"LastName": "Reagan",
17-
"City": "Bentonville"
13+
'ID': 3,
14+
'FirstName': 'Robert',
15+
'LastName': 'Reagan',
16+
'City': 'Bentonville',
1817
}, {
19-
"ID": 4,
20-
"FirstName": "Greta",
21-
"LastName": "Sims",
22-
"City": "Boise"
18+
'ID': 4,
19+
'FirstName': 'Greta',
20+
'LastName': 'Sims',
21+
'City': 'Boise',
2322
}, {
24-
"ID": 5,
25-
"FirstName": "Brett",
26-
"LastName": "Wade",
27-
"City": "Atlanta"
23+
'ID': 5,
24+
'FirstName': 'Brett',
25+
'LastName': 'Wade',
26+
'City': 'Atlanta',
2827
}];
2928

30-
$("#gridContainer").dxDataGrid({
29+
$('#gridContainer').dxDataGrid({
3130
dataSource: employees,
3231
columns: ['FirstName', 'LastName', 'Title', 'City', 'Country'],
3332
paging: {
34-
pageSize: 10
33+
pageSize: 10,
3534
},
3635
pager: {
37-
showPageSizeSelector: true,
38-
allowedPageSizes: [5, 10, 20]
36+
showPageSizeSelector: true,
37+
allowedPageSizes: [5, 10, 20],
3938
},
4039
editing: {
41-
mode: "row",
42-
allowUpdating: true,
43-
allowDeleting: true,
44-
allowAdding: true
40+
mode: 'row',
41+
allowUpdating: true,
42+
allowDeleting: true,
43+
allowAdding: true,
4544
},
46-
onContextMenuPreparing: function (e) {
47-
if (e.row.rowType === "data") {
48-
e.items = [{
49-
text: "edit",
50-
onItemClick: function () {
51-
e.component.editRow(e.row.rowIndex);
52-
}
45+
onContextMenuPreparing(e) {
46+
if (e.row.rowType === 'data') {
47+
e.items = [{
48+
text: 'edit',
49+
onItemClick() {
50+
e.component.editRow(e.row.rowIndex);
51+
},
52+
},
53+
{
54+
text: 'insert',
55+
onItemClick() {
56+
e.component.addRow();
5357
},
54-
{
55-
text: "insert",
56-
onItemClick: function () {
57-
e.component.addRow();
58-
}
58+
},
59+
{
60+
text: 'delete',
61+
onItemClick() {
62+
e.component.deleteRow(e.row.rowIndex);
5963
},
60-
{
61-
text: "delete",
62-
onItemClick: function () {
63-
e.component.deleteRow(e.row.rowIndex);
64-
}
65-
}];
64+
}];
6665
}
67-
}
66+
},
6867
});
69-
})
68+
});

0 commit comments

Comments
 (0)