Skip to content

Commit 331b316

Browse files
committed
Format code
1 parent dfe7504 commit 331b316

File tree

3 files changed

+51
-62
lines changed

3 files changed

+51
-62
lines changed

.github/workflows/lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
name: Run ESLint
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
13-
- uses: actions/setup-node@v1
14-
with:
15-
node-version: '12.x'
16-
- run: npm install
17-
- run: npm run lint
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: '12.x'
16+
- run: npm install
17+
- run: npm run lint

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
# eslint-config-web-scrobbler [![NPM][NpmBadge]][Npm] [![Test][WorkflowBadge]][Workflow]
1+
# eslint-config-web-scrobbler [![NPM][npm-badge]][npm] [![Test][workflow-badge]][workflow]
22

33
ESLint configuration file for Web Scrobbler projects.
44

55
## Usage
66

77
You can install `eslint-config-web-scrobbler` by a following way:
8+
89
```sh
910
> npm install --save-dev eslint-config-web-scrobbler
1011
```
1112

1213
Then, add `eslint-config-web-scrobbler` to the `extends` array in your
1314
`.eslintrc.*` file.
15+
1416
```json
1517
{
16-
"extends": [
17-
"some-other-config-you-use",
18-
"web-scrobbler"
19-
]
18+
"extends": ["some-other-config-you-use", "web-scrobbler"]
2019
}
2120
```
2221

@@ -25,9 +24,11 @@ Then, add `eslint-config-web-scrobbler` to the `extends` array in your
2524
Licensed under the [MIT License](./LICENSE).
2625

2726
<!-- Badges -->
28-
[NpmBadge]: https://img.shields.io/npm/v/eslint-config-web-scrobbler
29-
[WorkflowBadge]: https://github.com/web-scrobbler/eslint-config-web-scrobbler/workflows/Lint/badge.svg
27+
28+
[npm-badge]: https://img.shields.io/npm/v/eslint-config-web-scrobbler
29+
[workflow-badge]: https://github.com/web-scrobbler/eslint-config-web-scrobbler/workflows/Lint/badge.svg
3030

3131
<!-- Related pages -->
32-
[Npm]: https://www.npmjs.com/package/eslint-config-web-scrobbler
33-
[Workflow]: https://github.com/web-scrobbler/eslint-config-web-scrobbler/actions?query=workflow%3ALint
32+
33+
[npm]: https://www.npmjs.com/package/eslint-config-web-scrobbler
34+
[workflow]: https://github.com/web-scrobbler/eslint-config-web-scrobbler/actions?query=workflow%3ALint

index.js

Lines changed: 35 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
'use strict';
22

33
module.exports = {
4-
'env': {
5-
'es6': true,
6-
'node': true,
4+
env: {
5+
es6: true,
6+
node: true,
77
},
8-
'parserOptions': {
9-
'ecmaVersion': '2017'
8+
parserOptions: {
9+
ecmaVersion: '2017',
1010
},
11-
'extends': [
12-
'eslint:recommended'
13-
],
14-
'plugins': [
15-
'jsdoc'
16-
],
17-
'rules': {
11+
extends: ['eslint:recommended'],
12+
plugins: ['jsdoc'],
13+
rules: {
1814
/*
1915
* Possible errors
2016
*/
@@ -34,10 +30,10 @@ module.exports = {
3430
*/
3531

3632
// Enforce consistent brace style for all control statements
37-
'curly': 'error',
33+
curly: 'error',
3834

3935
// Require the use of === and !==
40-
'eqeqeq': 'error',
36+
eqeqeq: 'error',
4137

4238
// Disallow `else` blocks after `return` statements in `if` statements
4339
'no-else-return': 'error',
@@ -65,7 +61,7 @@ module.exports = {
6561
*/
6662

6763
// Require global strict mode directive
68-
'strict': ['error', 'global'],
64+
strict: ['error', 'global'],
6965

7066
/*
7167
* Stylistic issues
@@ -80,10 +76,10 @@ module.exports = {
8076
'array-bracket-spacing': ['error', 'never'],
8177

8278
// Require CamelCase
83-
'camelcase': ['error', { 'properties': 'never' }],
79+
camelcase: ['error', { properties: 'never' }],
8480

8581
// Require space after comma
86-
'comma-spacing': ['error', { 'after': true }],
82+
'comma-spacing': ['error', { after: true }],
8783

8884
// Require newline at the end of files
8985
'eol-last': ['error', 'always'],
@@ -93,14 +89,10 @@ module.exports = {
9389

9490
// Use tabs as indentation
9591
// Enforce indentation level for case clauses in switch statements
96-
'indent': [
97-
'error', 'tab', { 'SwitchCase': 1 }
98-
],
92+
indent: ['error', 'tab', { SwitchCase: 1 }],
9993

10094
// Require space after colon in object literal properties
101-
'key-spacing': [
102-
'error', { 'afterColon': true }
103-
],
95+
'key-spacing': ['error', { afterColon: true }],
10496

10597
// Require space before and after keywords
10698
'keyword-spacing': 'error',
@@ -109,9 +101,7 @@ module.exports = {
109101
'linebreak-style': ['error', 'unix'],
110102

111103
// Disallow empty block statements
112-
'no-empty': [
113-
'error', { 'allowEmptyCatch': true }
114-
],
104+
'no-empty': ['error', { allowEmptyCatch: true }],
115105

116106
// Disallow `if` statements as the only statement in `else` blocks
117107
'no-lonely-if': 'error',
@@ -137,17 +127,20 @@ module.exports = {
137127
'object-curly-spacing': ['error', 'always'],
138128

139129
// Require single quotes
140-
'quotes': ['error', 'single'],
130+
quotes: ['error', 'single'],
141131

142132
// Require space before blocks
143133
'space-before-blocks': ['error', 'always'],
144134

145135
// Disallow a space before function parenthesis
146-
'space-before-function-paren': ['error', {
147-
'named': 'never',
148-
'anonymous': 'never',
149-
'asyncArrow': 'always',
150-
}],
136+
'space-before-function-paren': [
137+
'error',
138+
{
139+
named: 'never',
140+
anonymous: 'never',
141+
asyncArrow: 'always',
142+
},
143+
],
151144

152145
// Disallow spaces inside of parentheses
153146
'space-in-parens': 'error',
@@ -159,12 +152,10 @@ module.exports = {
159152
'spaced-comment': 'error',
160153

161154
// Require semicolon at the end of statement
162-
'semi': ['error', 'always'],
155+
semi: ['error', 'always'],
163156

164157
// Enforce spacing around colons of switch statements
165-
'switch-colon-spacing': [
166-
'error', { 'after': true, 'before': false }
167-
],
158+
'switch-colon-spacing': ['error', { after: true, before: false }],
168159

169160
/*
170161
* ECMAScript 6
@@ -182,9 +173,7 @@ module.exports = {
182173

183174
// Require `const` declarations for variables
184175
// that are never reassigned after declared
185-
'prefer-const': [
186-
'error', { 'destructuring': 'all' }
187-
],
176+
'prefer-const': ['error', { destructuring: 'all' }],
188177

189178
// Require template literals instead of string concatenation
190179
'prefer-template': 'error',
@@ -199,9 +188,7 @@ module.exports = {
199188
'jsdoc/check-param-names': 'warn',
200189
'jsdoc/check-syntax': 'warn',
201190
'jsdoc/check-tag-names': 'warn',
202-
'jsdoc/check-types': [
203-
'warn', { 'noDefaults': true }
204-
],
191+
'jsdoc/check-types': ['warn', { noDefaults: true }],
205192
'jsdoc/no-undefined-types': 'warn',
206193
'jsdoc/require-param': 'warn',
207194
'jsdoc/require-param-description': 'warn',
@@ -212,11 +199,12 @@ module.exports = {
212199
'jsdoc/require-returns-type': 'warn',
213200
'jsdoc/valid-types': 'warn',
214201
},
215-
'settings': {
216-
'jsdoc': {
217-
'tagNamePreference': {
218-
'class': 'constructor', 'returns': 'return'
219-
}
202+
settings: {
203+
jsdoc: {
204+
tagNamePreference: {
205+
class: 'constructor',
206+
returns: 'return',
207+
},
220208
},
221209
},
222210
};

0 commit comments

Comments
 (0)