Skip to content

Commit 951c466

Browse files
author
Robert Jackson
committed
Add basic eslint setup.
Uses: * Prettier * eslint-plugin-node
1 parent 1e8fda6 commit 951c466

File tree

5 files changed

+434
-16
lines changed

5 files changed

+434
-16
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# do not ignore dotfiles
2+
!.*
3+
.git/
4+
5+
/node_modules

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2019,
5+
sourceType: 'script',
6+
},
7+
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
8+
plugins: ['prettier', 'node'],
9+
env: {
10+
node: true,
11+
},
12+
rules: {},
13+
overrides: [
14+
{
15+
files: ['test/**/*.js'],
16+
env: {
17+
mocha: true,
18+
},
19+
},
20+
],
21+
};

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"printWidth": 100
5+
}

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"ember-component-template-colocation-migrator": "./bin/ember-component-template-colocation-migrator"
1818
},
1919
"scripts": {
20-
"test": "mocha test/*-test.js test/**/*-test.js"
20+
"lint": "eslint .",
21+
"test": "mocha test/**/*-test.js"
2122
},
2223
"dependencies": {
2324
"@babel/core": "^7.7.5",
@@ -36,12 +37,20 @@
3637
},
3738
"devDependencies": {
3839
"assert-diff": "^2.0.3",
40+
"eslint": "^7.6.0",
41+
"eslint-config-prettier": "^6.11.0",
42+
"eslint-plugin-node": "^11.1.0",
43+
"eslint-plugin-prettier": "^3.1.4",
3944
"fixturify": "^1.0.1",
4045
"mocha": "^6.1.1",
46+
"prettier": "^2.0.5",
4147
"recast": "^0.19.1",
4248
"release-it": "^13.6.5",
4349
"release-it-lerna-changelog": "^2.3.0"
4450
},
51+
"engines": {
52+
"node": ">= 10"
53+
},
4554
"publishConfig": {
4655
"registry": "https://registry.npmjs.org"
4756
},

0 commit comments

Comments
 (0)