Skip to content

Commit cc95a23

Browse files
committed
Adding Airbnb ESLint rules
Disable usupported rules for specific ember apps Add a eslint-config-airbnb-base, eslint-plugin-ember, eslint-plugin-import to package.json Closes #58
1 parent 90117fb commit cc95a23

File tree

3 files changed

+108
-4
lines changed

3 files changed

+108
-4
lines changed

.eslintrc.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,22 @@ module.exports = {
1010
],
1111
extends: [
1212
'eslint:recommended',
13-
'plugin:ember/recommended'
13+
'plugin:ember/recommended',
14+
'airbnb-base'
1415
],
1516
env: {
1617
browser: true
1718
},
1819
rules: {
20+
// This rule has no support for @ember import system.
21+
// Ember build have their own mechanism to managing dependency.
22+
// Ember build will raise error on build if there is an import error.
23+
'import/extensions': 'off',
24+
'import/no-unresolved': 'off',
25+
'import/no-extraneous-dependencies': 'off',
26+
// Ember use underscore dangling, e.g _super. Which is enforced by ember's
27+
// own linter to be used on init() method.
28+
'no-underscore-dangle': 'off',
1929
},
2030
overrides: [
2131
// node files

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"ember-paper": "^1.0.0-alpha.19",
4444
"ember-source": "~3.1.0",
4545
"eslint": "^4.19.1",
46+
"eslint-config-airbnb-base": "12.1.0",
4647
"eslint-plugin-ember": "^5.0.0",
48+
"eslint-plugin-import": "^2.7.0",
4749
"github-api": "https://github.com/github-tools/github/archive/v3.1.0.tar.gz",
4850
"loader.js": "^4.2.3",
4951
"remark": "^9.0.0",

yarn.lock

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,6 +2310,10 @@ constants-browserify@~1.0.0:
23102310
version "1.0.0"
23112311
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
23122312

2313+
contains-path@^0.1.0:
2314+
version "0.1.0"
2315+
resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a"
2316+
23132317
23142318
version "0.5.2"
23152319
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
@@ -2669,6 +2673,13 @@ diffie-hellman@^5.0.0:
26692673
miller-rabin "^4.0.0"
26702674
randombytes "^2.0.0"
26712675

2676+
2677+
version "1.5.0"
2678+
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
2679+
dependencies:
2680+
esutils "^2.0.2"
2681+
isarray "^1.0.0"
2682+
26722683
doctrine@^2.1.0:
26732684
version "2.1.0"
26742685
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
@@ -3714,13 +3725,52 @@ escope@^3.6.0:
37143725
esrecurse "^4.1.0"
37153726
estraverse "^4.1.1"
37163727

3728+
3729+
version "12.1.0"
3730+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.1.0.tgz#386441e54a12ccd957b0a92564a4bafebd747944"
3731+
dependencies:
3732+
eslint-restricted-globals "^0.1.1"
3733+
3734+
eslint-import-resolver-node@^0.3.1:
3735+
version "0.3.2"
3736+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
3737+
dependencies:
3738+
debug "^2.6.9"
3739+
resolve "^1.5.0"
3740+
3741+
eslint-module-utils@^2.2.0:
3742+
version "2.2.0"
3743+
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746"
3744+
dependencies:
3745+
debug "^2.6.8"
3746+
pkg-dir "^1.0.0"
3747+
37173748
eslint-plugin-ember@^5.0.0:
37183749
version "5.2.0"
37193750
resolved "https://registry.yarnpkg.com/eslint-plugin-ember/-/eslint-plugin-ember-5.2.0.tgz#fa436e0497dfc01d1d38608229cd616e7c5b6067"
37203751
dependencies:
37213752
ember-rfc176-data "^0.3.3"
37223753
snake-case "^2.1.0"
37233754

3755+
eslint-plugin-import@^2.7.0:
3756+
version "2.12.0"
3757+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.12.0.tgz#dad31781292d6664b25317fd049d2e2b2f02205d"
3758+
dependencies:
3759+
contains-path "^0.1.0"
3760+
debug "^2.6.8"
3761+
doctrine "1.5.0"
3762+
eslint-import-resolver-node "^0.3.1"
3763+
eslint-module-utils "^2.2.0"
3764+
has "^1.0.1"
3765+
lodash "^4.17.4"
3766+
minimatch "^3.0.3"
3767+
read-pkg-up "^2.0.0"
3768+
resolve "^1.6.0"
3769+
3770+
eslint-restricted-globals@^0.1.1:
3771+
version "0.1.1"
3772+
resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7"
3773+
37243774
eslint-scope@^3.7.1:
37253775
version "3.7.1"
37263776
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
@@ -4184,7 +4234,7 @@ find-up@^1.0.0:
41844234
path-exists "^2.0.0"
41854235
pinkie-promise "^2.0.0"
41864236

4187-
find-up@^2.1.0:
4237+
find-up@^2.0.0, find-up@^2.1.0:
41884238
version "2.1.0"
41894239
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
41904240
dependencies:
@@ -4478,7 +4528,7 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.11:
44784528
mkdirp ">=0.5 0"
44794529
rimraf "2"
44804530

4481-
function-bind@^1.0.2:
4531+
function-bind@^1.0.2, function-bind@^1.1.1:
44824532
version "1.1.1"
44834533
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
44844534

@@ -4865,6 +4915,12 @@ has@^1.0.0:
48654915
dependencies:
48664916
function-bind "^1.0.2"
48674917

4918+
has@^1.0.1:
4919+
version "1.0.3"
4920+
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
4921+
dependencies:
4922+
function-bind "^1.1.1"
4923+
48684924
hash-base@^3.0.0:
48694925
version "3.0.4"
48704926
resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918"
@@ -5841,6 +5897,15 @@ load-json-file@^1.0.0:
58415897
pinkie-promise "^2.0.0"
58425898
strip-bom "^2.0.0"
58435899

5900+
load-json-file@^2.0.0:
5901+
version "2.0.0"
5902+
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
5903+
dependencies:
5904+
graceful-fs "^4.1.2"
5905+
parse-json "^2.2.0"
5906+
pify "^2.0.0"
5907+
strip-bom "^3.0.0"
5908+
58445909
load-plugin@^2.0.0:
58455910
version "2.2.2"
58465911
resolved "https://registry.yarnpkg.com/load-plugin/-/load-plugin-2.2.2.tgz#ebc7599491ff33e5077719fbe051d5725a9f7a89"
@@ -7432,6 +7497,12 @@ path-type@^1.0.0:
74327497
pify "^2.0.0"
74337498
pinkie-promise "^2.0.0"
74347499

7500+
path-type@^2.0.0:
7501+
version "2.0.0"
7502+
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
7503+
dependencies:
7504+
pify "^2.0.0"
7505+
74357506
pbkdf2@^3.0.3:
74367507
version "3.0.16"
74377508
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c"
@@ -7468,6 +7539,12 @@ pinkie@^2.0.0:
74687539
version "2.0.4"
74697540
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
74707541

7542+
pkg-dir@^1.0.0:
7543+
version "1.0.0"
7544+
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4"
7545+
dependencies:
7546+
find-up "^1.0.0"
7547+
74717548
pluralize@^7.0.0:
74727549
version "7.0.0"
74737550
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
@@ -7800,6 +7877,13 @@ read-pkg-up@^1.0.1:
78007877
find-up "^1.0.0"
78017878
read-pkg "^1.0.0"
78027879

7880+
read-pkg-up@^2.0.0:
7881+
version "2.0.0"
7882+
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
7883+
dependencies:
7884+
find-up "^2.0.0"
7885+
read-pkg "^2.0.0"
7886+
78037887
read-pkg@^1.0.0:
78047888
version "1.1.0"
78057889
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28"
@@ -7808,6 +7892,14 @@ read-pkg@^1.0.0:
78087892
normalize-package-data "^2.3.2"
78097893
path-type "^1.0.0"
78107894

7895+
read-pkg@^2.0.0:
7896+
version "2.0.0"
7897+
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
7898+
dependencies:
7899+
load-json-file "^2.0.0"
7900+
normalize-package-data "^2.3.2"
7901+
path-type "^2.0.0"
7902+
78117903
read@1, read@~1.0.1, read@~1.0.7:
78127904
version "1.0.7"
78137905
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
@@ -8190,7 +8282,7 @@ [email protected]:
81908282
dependencies:
81918283
path-parse "^1.0.5"
81928284

8193-
resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.3.0, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0:
8285+
resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.3.0, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0:
81948286
version "1.7.1"
81958287
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
81968288
dependencies:

0 commit comments

Comments
 (0)