Skip to content

Commit 355eec5

Browse files
KittyGiraudelpascalduez
authored andcommitted
Linted the whole codebase to standard
1 parent b5031ff commit 355eec5

Some content is hidden

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

68 files changed

+1478
-1501
lines changed

bin/sassdoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
'use strict';
3+
'use strict'
44

5-
require('../dist/cli').default(process.argv.slice(2));
5+
require('../dist/cli').default(process.argv.slice(2))

index.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
'use strict';
1+
'use strict'
22

3-
var sassdoc = require('./dist/sassdoc');
3+
var sassdoc = require('./dist/sassdoc')
44

5-
module.exports = sassdoc.default;
6-
module.exports.parseFilter = sassdoc.parseFilter;
7-
module.exports.ensureEnvironment = sassdoc.ensureEnvironment;
8-
module.exports.parse = sassdoc.parse;
9-
module.exports.Environment = sassdoc.Environment;
10-
module.exports.Logger = sassdoc.Logger;
11-
module.exports.Parser = sassdoc.Parser;
12-
module.exports.sorter = sassdoc.sorter;
13-
module.exports.errors = sassdoc.errors;
5+
module.exports = sassdoc.default
6+
module.exports.parseFilter = sassdoc.parseFilter
7+
module.exports.ensureEnvironment = sassdoc.ensureEnvironment
8+
module.exports.parse = sassdoc.parse
9+
module.exports.Environment = sassdoc.Environment
10+
module.exports.Logger = sassdoc.Logger
11+
module.exports.Parser = sassdoc.Parser
12+
module.exports.sorter = sassdoc.sorter
13+
module.exports.errors = sassdoc.errors

src/annotation/annotations/access.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
export default function access(env) {
1+
export default function access (env) {
22

3-
const defaultPrivatePrefixTest = RegExp.prototype.test.bind(/^[_-]/);
3+
const defaultPrivatePrefixTest = RegExp.prototype.test.bind(/^[_-]/)
44

55
return {
66
name: 'access',
77

8-
parse(text) {
9-
return text.trim();
8+
parse (text) {
9+
return text.trim()
1010
},
1111

12-
autofill(item) {
12+
autofill (item) {
1313
if (item.access !== 'auto') {
14-
return;
14+
return
1515
}
1616

1717
if (env.privatePrefix === false) {
18-
return;
18+
return
1919
}
2020

21-
let testFunc = defaultPrivatePrefixTest;
21+
let testFunc = defaultPrivatePrefixTest
2222

2323
if (typeof env.privatePrefix !== 'undefined') {
24-
testFunc = RegExp.prototype.test.bind(new RegExp(env.privatePrefix));
24+
testFunc = RegExp.prototype.test.bind(new RegExp(env.privatePrefix))
2525
}
2626

2727
if (testFunc(item.context.name)) {
28-
return 'private';
28+
return 'private'
2929
}
3030

31-
return 'public';
31+
return 'public'
3232
},
3333

34-
resolve(data) {
34+
resolve (data) {
3535
data.forEach(item => {
3636
// Ensure valid access when not autofilled.
3737
if (item.access === 'auto') {
38-
item.access = 'public';
38+
item.access = 'public'
3939
}
40-
});
40+
})
4141
},
4242

43-
default() {
44-
return 'auto';
43+
default () {
44+
return 'auto'
4545
},
4646

4747
multiple: false,
48-
};
48+
}
4949
}

src/annotation/annotations/alias.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
export default function alias(env) {
1+
export default function alias (env) {
22
return {
33
name: 'alias',
44

5-
parse(text) {
6-
return text.trim();
5+
parse (text) {
6+
return text.trim()
77
},
88

9-
resolve(data) {
9+
resolve (data) {
1010
data.forEach(item => {
1111
if (item.alias === undefined) {
12-
return;
12+
return
1313
}
1414

15-
let alias = item.alias;
16-
let name = item.context.name;
15+
let alias = item.alias
16+
let name = item.context.name
1717

18-
let aliasedItem = Array.find(data, i => i.context.name === alias);
18+
let aliasedItem = Array.find(data, i => i.context.name === alias)
1919

2020
if (aliasedItem === undefined) {
21-
env.logger.warn(`Item \`${name}\` is an alias of \`${alias}\` but this item doesn't exist.`);
22-
delete item.alias;
23-
return;
21+
env.logger.warn(`Item \`${name}\` is an alias of \`${alias}\` but this item doesn't exist.`)
22+
delete item.alias
23+
return
2424
}
2525

2626
if (!Array.isArray(aliasedItem.aliased)) {
27-
aliasedItem.aliased = [];
27+
aliasedItem.aliased = []
2828
}
2929

30-
aliasedItem.aliased.push(name);
31-
});
30+
aliasedItem.aliased.push(name)
31+
})
3232
},
3333

3434
allowedOn: ['function', 'mixin', 'variable'],
3535

3636
multiple: false,
37-
};
37+
}
3838
}

src/annotation/annotations/author.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export default function author() {
1+
export default function author () {
22
return {
33
name: 'author',
44

5-
parse(text) {
6-
return text.trim();
5+
parse (text) {
6+
return text.trim()
77
},
8-
};
8+
}
99
}

src/annotation/annotations/content.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
export default function content() {
1+
export default function content () {
22
return {
33
name: 'content',
44

5-
parse(text) {
6-
return text.trim();
5+
parse (text) {
6+
return text.trim()
77
},
88

9-
autofill(item) {
9+
autofill (item) {
1010
if (!item.content && item.context.code.indexOf('@content') > -1) {
11-
return '';
11+
return ''
1212
}
1313
},
1414

1515
allowedOn: ['mixin'],
1616

1717
multiple: false,
18-
};
18+
}
1919
}
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export default function deprecated() {
1+
export default function deprecated () {
22

33
return {
44
name: 'deprecated',
55

6-
parse(text) {
7-
return text.trim();
6+
parse (text) {
7+
return text.trim()
88
},
99

1010
multiple: false,
11-
};
11+
}
1212
}

src/annotation/annotations/example.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@
77
* <div></div>
88
*/
99

10-
const stripIndent = require('strip-indent');
11-
const descRegEx = /(\w+)\s*(?:-?\s*(.*))/;
10+
const stripIndent = require('strip-indent')
11+
const descRegEx = /(\w+)\s*(?:-?\s*(.*))/
1212

13-
export default function example() {
13+
export default function example () {
1414
return {
1515
name: 'example',
1616

17-
parse(text) {
17+
parse (text) {
1818
let instance = {
1919
type: 'scss', // Default to `scss`.
2020
code: text,
21-
};
21+
}
2222

2323
// Get the optional type info.
24-
let optionalType = text.substr(0, text.indexOf('\n'));
24+
let optionalType = text.substr(0, text.indexOf('\n'))
2525

2626
if (optionalType.trim().length !== 0) {
27-
let typeDesc = descRegEx.exec(optionalType);
28-
instance.type = typeDesc[1];
27+
let typeDesc = descRegEx.exec(optionalType)
28+
instance.type = typeDesc[1]
2929
if (typeDesc[2].length !== 0) {
30-
instance.description = typeDesc[2];
30+
instance.description = typeDesc[2]
3131
}
32-
instance.code = text.substr(optionalType.length + 1); // Remove the type
32+
instance.code = text.substr(optionalType.length + 1) // Remove the type
3333
}
3434

3535
// Remove all leading/trailing line breaks.
36-
instance.code = instance.code.replace(/^\n|\n$/g, '');
36+
instance.code = instance.code.replace(/^\n|\n$/g, '')
3737

38-
instance.code = stripIndent(instance.code);
38+
instance.code = stripIndent(instance.code)
3939

40-
return instance;
40+
return instance
4141
},
42-
};
42+
}
4343
}

src/annotation/annotations/group.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
export default function group() {
1+
export default function group () {
22
return {
33
name: 'group',
44

5-
parse(text) {
6-
return [text.trim().toLowerCase()];
5+
parse (text) {
6+
return [text.trim().toLowerCase()]
77
},
88

9-
default() {
10-
return ['undefined'];
9+
default () {
10+
return ['undefined']
1111
},
1212

1313
multiple: false,
14-
};
14+
}
1515
}

src/annotation/annotations/ignore.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ export default function ignore() {
22
return {
33
name: 'ignore',
44

5-
parse() {},
6-
};
5+
parse () {},
6+
}
77
}

src/annotation/annotations/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ module.exports = [
1818
require('./since.js').default,
1919
require('./throw.js').default,
2020
require('./todo.js').default,
21-
require('./type.js').default,
22-
];
21+
require('./type.js').default
22+
]

src/annotation/annotations/link.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
const linkRegex = /\s*([^:]+\:\/\/[^\s]*)?\s*(.*?)$/;
1+
const linkRegex = /\s*([^:]+\:\/\/[^\s]*)?\s*(.*?)$/
22

3-
export default function link() {
3+
export default function link () {
44
return {
55
name: 'link',
66

7-
parse(text) {
8-
let parsed = linkRegex.exec(text.trim());
7+
parse (text) {
8+
let parsed = linkRegex.exec(text.trim())
99

1010
return {
1111
url: parsed[1] || '',
1212
caption: parsed[2] || '',
13-
};
13+
}
1414
},
1515

1616
alias: ['source'],
17-
};
17+
}
1818
}

src/annotation/annotations/name.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
export default function access() {
1+
export default function name () {
22
return {
33
name: 'name',
44

5-
parse(text) {
6-
return text.trim();
5+
parse (text) {
6+
return text.trim()
77
},
88

99
// Abuse the autofill feature to rewrite the `item.context`
10-
autofill(item) {
10+
autofill (item) {
1111
if (item.name) {
12-
item.context.name = item.name;
12+
item.context.name = item.name
1313
// Cleanup
14-
delete item.name;
14+
delete item.name
1515
}
1616
},
1717

1818
multiple: false
19-
};
19+
}
2020
}

src/annotation/annotations/output.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
export default function output() {
1+
export default function output () {
22
return {
33
name: 'output',
44

5-
parse(text) {
6-
return text.trim();
5+
parse (text) {
6+
return text.trim()
77
},
88

99
alias: ['outputs'],
1010

1111
allowedOn: ['mixin'],
1212

1313
multiple: false,
14-
};
14+
}
1515
}

0 commit comments

Comments
 (0)