Skip to content

Commit

Permalink
Add linter to template, fix #9
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepolischuk committed Apr 23, 2016
1 parent 7932f7b commit 0d96312
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
temp
app
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"extends": "airbnb-base",
"rules": {
"comma-dangle": ["error", "never"],
"jsx-quotes": ["error", "prefer-single"],
"array-bracket-spacing": ["error", "always"]
},
"plugins": [
"require-path-exists"
]
}
7 changes: 6 additions & 1 deletion app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"index.es5.js"
],
"scripts": {
"test": "ava --require babel-register",
"test": "eslint . && ava --require babel-register",
"tdd": "chokidar \"*.js\" --ignore \"*.es5.js\" --command \"npm run test\" --initial",
"prepublish": "babel index.js --out-file index.es5.js<% if (cli) { %> && babel cli.js --out-file cli.es5.js<% } %>",
"postpublish": "rimraf index.es5.js<% if (cli) { %> cli.es5.js<% } %> && git push --follow-tags"
Expand All @@ -33,10 +33,15 @@
"devDependencies": {
"ava": "^0.14.0",
"babel-cli": "^6.7.5",
"babel-eslint": "^6.0.3",
"babel-plugin-add-module-exports": "^0.1.1",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.7.2",
"chokidar-cli": "^1.1.0",
"eslint": "^2.8.0",
"eslint-config-airbnb-base": "^1.0.3",
"eslint-plugin-import": "^1.5.0",
"eslint-plugin-require-path-exists": "^1.1.5",
"rimraf": "^2.5.2"
}
}
12 changes: 12 additions & 0 deletions app/templates/eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parser": "babel-eslint",
"extends": "airbnb-base",
"rules": {
"comma-dangle": ["error", "never"],
"jsx-quotes": ["error", "prefer-single"],
"array-bracket-spacing": ["error", "always"]
},
"plugins": [
"require-path-exists"
]
}

This comment has been minimized.

Copy link
@iamstarkov

iamstarkov Apr 24, 2016

You don't need to create this, because esljnt-init will generate it for you

This comment has been minimized.

Copy link
@andrepolischuk

andrepolischuk Apr 24, 2016

Author Owner

Thanks, at first I thought mistakenly that I can tweak only plugins and extends with eslint-init

This comment has been minimized.

Copy link
@iamstarkov

iamstarkov Apr 25, 2016

thats fine,
i did the same in zen 1 and 2

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"homepage": "https://github.com/andrepolischuk/generator-mo#readme",
"dependencies": {
"generator-babel": "^2.0.2",
"generator-eslint-init": "^1.1.0",
"generator-travis": "^1.2.4",
"gh-user": "^2.1.0",
"pinkie-promise": "^2.0.1",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default class Module extends Base {
}

mv('editorconfig', '.editorconfig');
mv('eslintrc.json', '.eslintrc.json');
mv('gitignore', '.gitignore');
mv('_package.json', 'package.json');
};
Expand Down
2 changes: 2 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test.serial('generate files', async () => {
assert.file([
'.babelrc',
'.editorconfig',
'.eslintrc.json',
'.git',
'.gitignore',
'.travis.yml',
Expand Down Expand Up @@ -53,6 +54,7 @@ test.serial('generate files with CLI', async () => {
assert.file([
'.babelrc',
'.editorconfig',
'.eslintrc.json',
'.git',
'.gitignore',
'.travis.yml',
Expand Down

0 comments on commit 0d96312

Please sign in to comment.