Skip to content

Commit 58680b3

Browse files
committed
style: fix eslint
1 parent cb23dc3 commit 58680b3

13 files changed

Lines changed: 224 additions & 33 deletions

File tree

.eslintignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88

99
# dependencies
1010
/bower_components/
11+
/node_modules/
1112

1213
# misc
1314
/coverage/
15+
!.*
16+
!.eslintrc.js
17+
.vscode/
1418

1519
# ember-try
1620
/.node_modules.ember-try/
17-
18-
/tests/
21+
/bower.json.ember-try
22+
/package.json.ember-try

.eslintrc.js

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,55 @@
1+
'use strict';
2+
3+
// @TODO this can be removed once `trailingComma` is enabled upstream by default
4+
const prettierTrailingComma = {
5+
'prettier/prettier': [
6+
'error',
7+
require('@clark/prettier-config/trailing-comma'),
8+
],
9+
};
10+
11+
const ruleOverrides = {
12+
...prettierTrailingComma,
13+
};
14+
115
module.exports = {
216
root: true,
3-
extends: '@clark/node'
17+
extends: ['@clark'],
18+
parser: '@babel/eslint-parser',
19+
parserOptions: {
20+
requireConfigFile: false,
21+
},
22+
rules: {
23+
...ruleOverrides,
24+
},
25+
overrides: [
26+
{
27+
files: ['app/**/*.js'],
28+
extends: '@clark/ember',
29+
rules: { ...ruleOverrides },
30+
},
31+
{
32+
files: ['addon-test-support/**/*.js', 'tests/**/*.js'],
33+
excludedFiles: ['tests/dummy/config/**/*.js'],
34+
extends: '@clark/ember/test',
35+
rules: { ...ruleOverrides },
36+
},
37+
{
38+
files: ['addon-test-support/**/*.js'],
39+
rules: {
40+
'qunit/no-commented-tests': 'off',
41+
},
42+
},
43+
{
44+
files: [
45+
'./*.js',
46+
'blueprints/*/index.js',
47+
'config/**/*.js',
48+
'tests/dummy/config/**/*.js',
49+
'lib/**/*.js',
50+
],
51+
extends: '@clark/node',
52+
rules: { ...ruleOverrides },
53+
},
54+
],
455
};

.template-lintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
extends: 'recommended'
4+
extends: 'recommended',
55
};

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ module.exports = {
1414

1515
createCssModulesPlugin(parent) {
1616
return new ClarkPlugin(parent);
17-
}
17+
},
1818
};

lib/clark-plugin.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ module.exports = class ClarkPlugin extends Plugin {
4747
// Iterate over lists with @each
4848
require('postcss-advanced-variables')({
4949
disable: '@mixin, @include, @content',
50-
unresolved: 'ignore'
50+
unresolved: 'ignore',
5151
}),
5252

5353
// https://github.com/jonathantneal/postcss-short
5454
// Shorthand properties
55-
require('postcss-short')
55+
require('postcss-short'),
5656

5757
// https://github.com/simonsmith/postcss-property-lookup
5858
// Lookup property values of the current rule set, e.g. padding-top: @margin-bottom
@@ -100,15 +100,15 @@ module.exports = class ClarkPlugin extends Plugin {
100100
'matches-pseudo-class': true,
101101
'has-pseudo-class': true,
102102

103-
'custom-selectors': true
103+
'custom-selectors': true,
104104
},
105105

106106
autoprefixer: {
107107
// We don't manually apply prefixes unless they are really necessary,
108108
// e.g.when dealing with quirks, therefore we disable removing them.
109-
remove: false
110-
}
111-
})
109+
remove: false,
110+
},
111+
}),
112112
];
113113

114114
for (const [stage, plugins] of Object.entries({ before, after })) {
@@ -119,8 +119,8 @@ module.exports = class ClarkPlugin extends Plugin {
119119
postcssOptions: {
120120
// https://github.com/postcss/postcss-scss
121121
// This allows you to use inline comments, like this one here.
122-
parser: require('postcss-scss')
123-
}
122+
parser: require('postcss-scss'),
123+
},
124124
};
125125
}
126126
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"postcss-short": "^5.0.0"
3737
},
3838
"devDependencies": {
39+
"@babel/eslint-parser": "^7.14.7",
40+
"@clark/eslint-config-ember": "^2.2.0",
3941
"@clark/eslint-config-node": "^2.2.0",
4042
"@clark/prettier-config": "^2.2.0",
4143
"@ember/optional-features": "^2.0.0",

testem.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ module.exports = {
1414
'--disable-software-rasterizer',
1515
'--mute-audio',
1616
'--remote-debugging-port=0',
17-
'--window-size=1440,900'
18-
].filter(Boolean)
19-
}
20-
}
17+
'--window-size=1440,900',
18+
].filter(Boolean),
19+
},
20+
},
2121
};

tests/dummy/app/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Application from '@ember/application';
2+
23
import loadInitializers from 'ember-load-initializers';
34

45
import config from './config/environment';

tests/dummy/app/router.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import EmberRouter from '@ember/routing/router';
2+
23
import config from './config/environment';
34

45
export default class Router extends EmberRouter {
56
location = config.locationType;
67
rootURL = config.rootURL;
7-
};
8+
}
89

9-
Router.map(function() {
10-
});
10+
Router.map(function () {});

tests/dummy/config/environment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
module.exports = function(environment) {
4-
let ENV = {
3+
module.exports = function (environment) {
4+
const ENV = {
55
modulePrefix: 'dummy',
66
environment,
77
rootURL: '/',
@@ -13,14 +13,14 @@ module.exports = function(environment) {
1313
},
1414
EXTEND_PROTOTYPES: {
1515
// Prevent Ember Data from overriding Date.parse.
16-
Date: false
17-
}
16+
Date: false,
17+
},
1818
},
1919

2020
APP: {
2121
// Here you can pass flags/options to your application instance
2222
// when it is created
23-
}
23+
},
2424
};
2525

2626
if (environment === 'development') {

0 commit comments

Comments
 (0)