Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

Commit f039c24

Browse files
committed
feat(eslint): Simplify setup and include two additional plugins
BREAKING CHANGE: This adds [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) and the [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) which might introduce new linting errors. You might want to turn off rules in `/.eslintrc.json` in case you find them too opinionated.
1 parent 0ba7030 commit f039c24

File tree

6 files changed

+8
-36
lines changed

6 files changed

+8
-36
lines changed

__tests__/test-app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ describe('Baumeister with default options', () => {
109109
'.babelrc',
110110
'.travis.yml',
111111
'.eslintrc.json',
112-
'src/app/.eslintrc.json',
113112
'.stylelintrc.json'
114113
]);
115114
});
@@ -813,8 +812,7 @@ describe('Baumeister using --yo-rc flag', () => {
813812
'.editorconfig',
814813
'.gitattributes',
815814
'.gitignore',
816-
'.eslintrc.json',
817-
'src/app/.eslintrc.json'
815+
'.eslintrc.json'
818816
]);
819817
});
820818

app/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ module.exports = class extends Generator {
287287
this.templatePath('eslintrc.json'),
288288
this.destinationPath('.eslintrc.json')
289289
);
290-
this.fs.copyTpl(
291-
this.templatePath('src/app/eslintrc.json'),
292-
this.destinationPath('src/app/.eslintrc.json')
293-
);
294290
this.fs.copyTpl(
295291
this.templatePath('stylelintrc.json'),
296292
this.destinationPath('.stylelintrc.json')

app/templates/_package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@
5656
"core-js": "^2.5.3",
5757
"cssnano": "^3.10.0",
5858
"del": "^3.0.0",
59-
"eslint-config-xo": "0.19.0",
59+
"eslint": "^4.17.0",
60+
"eslint-config-baumeister": "0.1.0",
61+
"eslint-config-xo": "^0.19.0",
6062
"eslint-plugin-filenames": "^1.2.0",
63+
"eslint-plugin-import": "^2.8.0",
6164
"eslint-plugin-security": "^1.4.0",
65+
"eslint-plugin-unicorn": "^3.0.1",
6266
"gulp": "^4.0.0",
6367
"gulp-banner": "^0.1.3",
6468
"gulp-bootlint": "^0.8.1",

app/templates/eslintrc.json

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
{
2-
"extends": "xo/esnext",
3-
"plugins": [
4-
"security",
5-
"filenames"
6-
],
7-
"rules": {
8-
"padded-blocks": ["off"],
9-
"operator-assignment": ["off"],
10-
"eqeqeq": ["error", "allow-null"],
11-
"no-eq-null": ["off"],
12-
"quote-props": ["error", "as-needed"],
13-
"capitalized-comments": ["warn"],
14-
"curly": ["error", "multi-line"],
15-
"arrow-parens": ["off"],
16-
"no-debugger": ["warn"],
17-
"filenames/match-exported": [2, "kebab"]
18-
}
2+
"extends": "baumeister"
193
}

app/templates/gulp/tasks/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function test(done) {
1616

1717
jest.runCLI({config: pkgJson.jest}, '.').then(result => {
1818
if (isProdBuild() && !result.success) {
19-
return done() && process.exit(1);
19+
return done() && process.exit(1); // eslint-disable-line unicorn/no-process-exit
2020
}
2121
return done();
2222
});

app/templates/src/app/eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)