Skip to content

Commit c0e5369

Browse files
committed
#21 - ESLint added, code cleaned
1 parent 449fe3c commit c0e5369

File tree

147 files changed

+6425
-5643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+6425
-5643
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
4+
env: {
5+
node: true
6+
},
7+
8+
rules: {
9+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
10+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
11+
},
12+
13+
parserOptions: {
14+
parser: 'babel-eslint'
15+
},
16+
17+
extends: [
18+
'plugin:vue/essential',
19+
'@vue/standard'
20+
]
21+
}

examples/crm/config/api.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export const api = {
2-
url: 'http://crm-api.id-a.pl/',
3-
path: {
4-
default: 'api',
5-
storage: 'storage/',
6-
upload: 'files/file-upload'
7-
}
2+
url: 'http://crm-api.id-a.pl/',
3+
path: {
4+
default: 'api',
5+
storage: 'storage/',
6+
upload: 'files/file-upload'
7+
}
88
}

examples/crm/config/crud.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
export const crud = {
2-
fieldModifiers: {
3-
dateFromTimestamp: (param) => {
4-
return param.substring(0, 10)
5-
},
6-
timeFromTimestamp: (param) => {
7-
let tmp = param || ''
8-
return tmp.substring(0, 5)
9-
},
10-
datetimeFromTimestamp: (param) => {
11-
return '<nobr>' + param.substring(0, 19) + '</nobr>'
12-
},
13-
croppedText: (param) => {
14-
return (param == null || param.length < 100) ? param : param.substring(0, 100) + '...'
15-
},
16-
list: (param) => {
17-
return param ? param.map(obj => obj.tableList).join(', ') : ''
18-
},
19-
listTasks: (param) => {
20-
return param ? param.map(obj => {
21-
return obj.task.name
22-
}).join('<br>') : ''
23-
},
24-
lastReset: (param) => {
25-
if (param.length > 0) {
26-
return '<nobr>' + param[param.length - 1].reset_time.substring(0, 19) + '</nobr>'
27-
}
28-
}
2+
fieldModifiers: {
3+
dateFromTimestamp: (param) => {
4+
return param.substring(0, 10)
5+
},
6+
timeFromTimestamp: (param) => {
7+
let tmp = param || ''
8+
return tmp.substring(0, 5)
9+
},
10+
datetimeFromTimestamp: (param) => {
11+
return '<nobr>' + param.substring(0, 19) + '</nobr>'
12+
},
13+
croppedText: (param) => {
14+
return (param == null || param.length < 100) ? param : param.substring(0, 100) + '...'
15+
},
16+
list: (param) => {
17+
return param ? param.map(obj => obj.tableList).join(', ') : ''
18+
},
19+
listTasks: (param) => {
20+
return param ? param.map(obj => {
21+
return obj.task.name
22+
}).join('<br>') : ''
23+
},
24+
lastReset: (param) => {
25+
if (param.length > 0) {
26+
return '<nobr>' + param[param.length - 1].reset_time.substring(0, 19) + '</nobr>'
27+
}
2928
}
30-
}
29+
}
30+
}

examples/crm/config/main.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
export const main = {
2-
title: "Vue CRUD",
3-
locales: [{
4-
name: 'en',
5-
text: 'English'
6-
},
7-
{
8-
name: 'pl',
9-
text: 'Polski'
10-
},
11-
],
12-
defaultLocale: 'en',
13-
iconfont: 'md',
14-
primaryTheme: 'dark',
15-
secondaryTheme: 'dark',
16-
theme: {
17-
primary: '#34495e',
18-
secondary: '#41b883',
19-
accent: '#82B1FF',
20-
error: '#FF5252',
21-
info: '#2196F3',
22-
success: '#4CAF50',
23-
warning: '#FFC107'
24-
},
25-
}
2+
title: 'Vue CRUD',
3+
locales: [{
4+
name: 'en',
5+
text: 'English'
6+
},
7+
{
8+
name: 'pl',
9+
text: 'Polski'
10+
}
11+
],
12+
defaultLocale: 'en',
13+
iconfont: 'md',
14+
primaryTheme: 'dark',
15+
secondaryTheme: 'dark',
16+
theme: {
17+
primary: '#34495e',
18+
secondary: '#41b883',
19+
accent: '#82B1FF',
20+
error: '#FF5252',
21+
info: '#2196F3',
22+
success: '#4CAF50',
23+
warning: '#FFC107'
24+
}
25+
}

examples/crm/config/store-modules.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import administration from '@/routes/app/routes/administration/store/'
33
import crm from '@/routes/app/routes/crm/store/'
44

55
export default {
6-
administration,
7-
crm
8-
}
6+
administration,
7+
crm
8+
}

examples/crm/locales/en/datatable.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,40 @@ export default {
77
list: 'List'
88
}
99
},
10-
noItemsSelected: "No items selected",
11-
confirm: "Are you sure?",
10+
noItemsSelected: 'No items selected',
11+
confirm: 'Are you sure?',
1212
fields: {
13-
action: "Action",
13+
action: 'Action',
1414
status: 'Status'
1515
},
1616
status: {
17-
title: "Statuses",
18-
active: "Active",
19-
inactive: "Inactive"
17+
title: 'Statuses',
18+
active: 'Active',
19+
inactive: 'Inactive'
2020
},
2121
searchByColumns: 'Search by fields',
22-
search: "Search",
23-
noMatchingResults: "No matching records found",
24-
noDataAvailable: "No data available",
25-
rowsPerPageText: "Rows per page:",
26-
records: "Records",
22+
search: 'Search',
23+
noMatchingResults: 'No matching records found',
24+
noDataAvailable: 'No data available',
25+
rowsPerPageText: 'Rows per page:',
26+
records: 'Records',
2727
page: 'Page',
28-
from: "from",
29-
add: "Add",
30-
all: "All",
28+
from: 'from',
29+
add: 'Add',
30+
all: 'All',
3131
buttons: {
32-
edit: "Edit",
33-
suspend: "Suspend",
34-
restore: "Restore",
35-
delete: "Delete",
32+
edit: 'Edit',
33+
suspend: 'Suspend',
34+
restore: 'Restore',
35+
delete: 'Delete',
3636
editSelected: 'Edit selected',
37-
suspendSelected: "Suspend selected",
38-
restoreSelected: "Restore selected",
39-
deleteSelected: "Delete selected",
40-
download: "Download",
41-
show: "Show",
42-
refreshTable: "Refresh table",
37+
suspendSelected: 'Suspend selected',
38+
restoreSelected: 'Restore selected',
39+
deleteSelected: 'Delete selected',
40+
download: 'Download',
41+
show: 'Show',
42+
refreshTable: 'Refresh table',
4343
copyToExcel: 'Copy to Excel',
4444
clearFilters: 'Clear filters'
4545
}
4646
}
47-

examples/crm/locales/en/details.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
export default {
2-
multipleUpdateTitle: "Multiple records update",
2+
multipleUpdateTitle: 'Multiple records update',
33
title: 'Details',
44
rules: {
5-
required: "Field is required",
6-
atLeast: "Field must be at least",
7-
less: "Field must be less than",
8-
more: "Pole musi mieć more than",
9-
characters: "characters",
10-
emailMustBeValid: "E-mail must be valid",
11-
passwordMustDiffer: "New password must be different from the old password",
5+
required: 'Field is required',
6+
atLeast: 'Field must be at least',
7+
less: 'Field must be less than',
8+
more: 'Pole musi mieć more than',
9+
characters: 'characters',
10+
emailMustBeValid: 'E-mail must be valid',
11+
passwordMustDiffer: 'New password must be different from the old password',
1212
passwordMustBeSame: "Password can't be different"
1313
},
1414
alerts: {
15-
updated: "Updated",
16-
updateError: "Error! Update unsuccessful",
17-
stored: "Dodano",
18-
storeError: "Error! Store unsuccessful"
15+
updated: 'Updated',
16+
updateError: 'Error! Update unsuccessful',
17+
stored: 'Dodano',
18+
storeError: 'Error! Store unsuccessful'
1919
},
2020
buttons: {
21-
create: "Create",
22-
modify: "Modify",
23-
modifySelected: "Modify selected records",
24-
close: "Close"
21+
create: 'Create',
22+
modify: 'Modify',
23+
modifySelected: 'Modify selected records',
24+
close: 'Close'
2525
},
2626
files: {
27-
upload: "Upload file",
28-
show: "Show",
29-
download: "Download"
30-
},
27+
upload: 'Upload file',
28+
show: 'Show',
29+
download: 'Download'
30+
}
3131
}
32-

examples/crm/locales/en/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import alerts from './alerts.js'
2-
import routes from './routes.js'
3-
import login from './login.js'
4-
import profile from './profile.js'
5-
import datatable from './datatable.js'
6-
import details from './details.js'
7-
import itemElements from './item-elements.js'
1+
import alerts from './alerts'
2+
import routes from './routes'
3+
import login from './login'
4+
import profile from './profile'
5+
import datatable from './datatable'
6+
import details from './details'
7+
import itemElements from './item-elements'
88

99
export default {
10-
global: {
11-
alerts,
12-
routes,
13-
login,
14-
profile,
15-
datatable,
16-
details,
17-
itemElements,
18-
},
19-
}
10+
global: {
11+
alerts,
12+
routes,
13+
login,
14+
profile,
15+
datatable,
16+
details,
17+
itemElements
18+
}
19+
}
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
export default {
2-
available: "Available",
3-
selected: "Selected",
4-
noItemsSelected: "No items selected",
5-
confirm: "Are you sure?",
2+
available: 'Available',
3+
selected: 'Selected',
4+
noItemsSelected: 'No items selected',
5+
confirm: 'Are you sure?',
66
fields: {
7-
action: "Action",
8-
name: "Name",
9-
added: "Added"
7+
action: 'Action',
8+
name: 'Name',
9+
added: 'Added'
1010
},
1111
status: {
12-
title: "Status",
13-
added: "Added",
14-
noAdded: "No added"
12+
title: 'Status',
13+
added: 'Added',
14+
noAdded: 'No added'
1515
},
16-
search: "Search",
17-
noMatchingResults: "No matching records found",
18-
noDataAvailable: "No data available",
19-
rowsPerPageText: "Rows per page:",
20-
records: "Records",
21-
from: "from",
22-
add: "Add",
23-
all: "All",
16+
search: 'Search',
17+
noMatchingResults: 'No matching records found',
18+
noDataAvailable: 'No data available',
19+
rowsPerPageText: 'Rows per page:',
20+
records: 'Records',
21+
from: 'from',
22+
add: 'Add',
23+
all: 'All',
2424
buttons: {
25-
remove: "Dalete",
26-
add: "Add",
27-
removeMany: "Delete many",
28-
addMany: "Add many",
29-
close: "Close"
25+
remove: 'Dalete',
26+
add: 'Add',
27+
removeMany: 'Delete many',
28+
addMany: 'Add many',
29+
close: 'Close'
3030
}
3131
}
32-

0 commit comments

Comments
 (0)