Skip to content

Commit

Permalink
Add prettier and lint all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Marcondes authored and berleant committed Jan 25, 2018
1 parent 9125217 commit 286d4f0
Show file tree
Hide file tree
Showing 281 changed files with 6,412 additions and 4,975 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage/*
public/build/*
src/javascripts/_vendor/*
lib/core/vendor/*
45 changes: 11 additions & 34 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
"mocha": true,
"browser": true
},
"plugins": [
"mocha",
],
"plugins": ["mocha"],
"extends": [
"airbnb-base",
"plugin:vue/recommended"
"plugin:vue/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"comma-dangle": [2, "always-multiline"],
"arrow-body-style": 0,
"consistent-return": 0,
"new-cap": [
1,
Expand All @@ -31,39 +32,15 @@
]
}
],
"mocha/no-exclusive-tests": [
0,
{}
],
"no-param-reassign": [
0,
{}
],
"no-underscore-dangle": [
0,
{}
],
"global-require": [
0
],
"arrow-body-style": [
1,
"as-needed"
],
"no-global-assign": [
0
],
"mocha/no-exclusive-tests": [0, {}],
"no-param-reassign": [0, {}],
"no-underscore-dangle": [0, {}],
"global-require": [0],
"no-global-assign": [0],
"no-shadow": [
0,
{
"allow": [
"done",
"err",
"res",
"req",
"resolve",
"reject"
]
"allow": ["done", "err", "res", "req", "resolve", "reject"]
}
],
"jsx-uses-vars": 0
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/*
coverage/*
public/build/*
src/javascripts/_vendor/*
lib/core/vendor/*
4 changes: 1 addition & 3 deletions ACL/ACL/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
Visitor: [
[true],
],
Visitor: [[true]],
};
41 changes: 19 additions & 22 deletions ACL/Admin.Collectives.Campaigns.Events/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
/* globals User */
module.exports = {
Visitor: [
[false],
],
User: [
[false],
['index', true],
],
Visitor: [[false]],
User: [[false], ['index', true]],
CollectiveManager: [
['index', true],
['create', 'delete', (req) =>
User.knex().table('CollectiveAdmins')
.where({
collective_id: req.post.collectiveId,
user_id: req.user.id,
})
.then((results) => {
if (results.length === 0) {
return false;
}
[
'create',
'delete',
req =>
User.knex()
.table('CollectiveAdmins')
.where({
collective_id: req.post.collectiveId,
user_id: req.user.id,
})
.then(results => {
if (results.length === 0) {
return false;
}

return true;
}),
return true;
}),
],
],
Admin: [
[true],
],
Admin: [[true]],
};
41 changes: 19 additions & 22 deletions ACL/Admin.Collectives.Campaigns.KBPosts/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
/* globals User */
module.exports = {
Visitor: [
[false],
],
User: [
[false],
['index', true],
],
Visitor: [[false]],
User: [[false], ['index', true]],
CollectiveManager: [
['index', true],
['create', 'delete', (req) =>
User.knex().table('CollectiveAdmins')
.where({
collective_id: req.post.collectiveId,
user_id: req.user.id,
})
.then((results) => {
if (results.length === 0) {
return false;
}
[
'create',
'delete',
req =>
User.knex()
.table('CollectiveAdmins')
.where({
collective_id: req.post.collectiveId,
user_id: req.user.id,
})
.then(results => {
if (results.length === 0) {
return false;
}

return true;
}),
return true;
}),
],
],
Admin: [
[true],
],
Admin: [[true]],
};
50 changes: 26 additions & 24 deletions ACL/Admin.Collectives.Campaigns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@ module.exports = {
Visitor: [
['new', 'create', 'edit', 'update', 'activate', 'deactivate', false],
],
User: [
['new', 'create', 'edit', 'update', 'activate', 'deactivate', false],
],
User: [['new', 'create', 'edit', 'update', 'activate', 'deactivate', false]],
CollectiveManager: [
['new', 'create', true],
['edit', 'update', 'activate', 'deactivate', (req) => {
Admin.Campaign.query()
.where('id', req.params.id)
.then(([campaign]) => {
return Admin.Campaign.knex()
.table('CollectiveAdmins')
.where({
collective_id: campaign.collectiveId,
user_id: req.user.id,
});
})
.then((results) => {
if (results.length === 0) {
return false;
}
[
'edit',
'update',
'activate',
'deactivate',
req => {
Admin.Campaign.query()
.where('id', req.params.id)
.then(([campaign]) =>
Admin.Campaign.knex()
.table('CollectiveAdmins')
.where({
collective_id: campaign.collectiveId,
user_id: req.user.id,
}),
)
.then(results => {
if (results.length === 0) {
return false;
}

return true;
});
}],
],
Admin: [
['new', 'create', 'edit', 'update', 'activate', 'deactivate', true],
return true;
});
},
],
],
Admin: [['new', 'create', 'edit', 'update', 'activate', 'deactivate', true]],
};
43 changes: 21 additions & 22 deletions ACL/Admin.Collectives.Users/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
/* globals User */
module.exports = {
Visitor: [
[false],
],
User: [
[false],
],
Visitor: [[false]],
User: [[false]],
CollectiveManager: [
['index', true],
['show', 'edit', 'update', (req) => {
return User.knex().table('CollectiveAdmins')
.where({
collective_id: req.params.id,
user_id: req.user.id,
})
.then((results) => {
if (results.length === 0) {
return false;
}
[
'show',
'edit',
'update',
req =>
User.knex()
.table('CollectiveAdmins')
.where({
collective_id: req.params.id,
user_id: req.user.id,
})
.then(results => {
if (results.length === 0) {
return false;
}

return true;
});
}],
],
Admin: [
[true],
return true;
}),
],
],
Admin: [[true]],
};
43 changes: 21 additions & 22 deletions ACL/Admin.Collectives/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
/* globals User */
module.exports = {
Visitor: [
[false],
],
User: [
[false],
],
Visitor: [[false]],
User: [[false]],
CollectiveManager: [
['index', true],
['show', 'edit', 'update', (req) => {
return User.knex().table('CollectiveAdmins')
.where({
collective_id: req.params.id,
user_id: req.user.id,
})
.then((results) => {
if (results.length === 0) {
return false;
}
[
'show',
'edit',
'update',
req =>
User.knex()
.table('CollectiveAdmins')
.where({
collective_id: req.params.id,
user_id: req.user.id,
})
.then(results => {
if (results.length === 0) {
return false;
}

return true;
});
}],
],
Admin: [
[true],
return true;
}),
],
],
Admin: [[true]],
};
12 changes: 3 additions & 9 deletions ACL/Admin.Disputes/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
module.exports = {
Visitor: [
[false],
],
User: [
[false],
],
Admin: [
[true],
],
Visitor: [[false]],
User: [[false]],
Admin: [[true]],
};
12 changes: 3 additions & 9 deletions ACL/Admin.Users/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
module.exports = {
Visitor: [
[false],
],
User: [
[false],
],
Admin: [
[true],
],
Visitor: [[false]],
User: [[false]],
Admin: [[true]],
};
Loading

0 comments on commit 286d4f0

Please sign in to comment.