Skip to content

Commit aca93e1

Browse files
committed
replace ember-cli-eslint with eslint
1 parent 049beb5 commit aca93e1

File tree

11 files changed

+877
-285
lines changed

11 files changed

+877
-285
lines changed

.eslintignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.*/
17+
.eslintcache
18+
19+
# ember-try
20+
/.node_modules.ember-try/
21+
/bower.json.ember-try
22+
/npm-shrinkwrap.json.ember-try
23+
/package.json.ember-try
24+
/package-lock.json.ember-try
25+
/yarn.lock.ember-try

.eslintrc.js

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,66 @@
1+
'use strict';
2+
13
module.exports = {
24
root: true,
5+
parser: '@babel/eslint-parser',
36
parserOptions: {
4-
ecmaVersion: 2018,
5-
sourceType: 'module'
7+
ecmaVersion: 2022,
8+
sourceType: 'module',
9+
ecmaFeatures: {
10+
legacyDecorators: true,
11+
},
12+
requireConfigFile: false,
13+
babelOptions: {
14+
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
15+
},
616
},
7-
extends: 'eslint:recommended',
17+
plugins: ['ember'],
18+
extends: [
19+
'eslint:recommended',
20+
'plugin:ember/recommended',
21+
],
822
env: {
9-
browser: true
23+
browser: true,
1024
},
1125
rules: {
26+
'ember/new-module-imports': 'off',
27+
'ember/no-get': 'off',
28+
'ember/no-private-routing-service': 'off'
1229
},
1330
overrides: [
1431
// node files
1532
{
1633
files: [
17-
'.eslintrc.js',
18-
'.template-lintrc.js',
19-
'ember-cli-build.js',
20-
'index.js',
21-
'testem.js',
22-
'blueprints/*/index.js',
23-
'config/**/*.js',
24-
'tests/dummy/config/**/*.js'
25-
],
26-
excludedFiles: [
27-
'addon/**',
28-
'addon-test-support/**',
29-
'app/**',
30-
'tests/dummy/app/**'
34+
'./.eslintrc.js',
35+
'./.prettierrc.js',
36+
'./.template-lintrc.js',
37+
'./ember-cli-build.js',
38+
'./index.js',
39+
'./testem.js',
40+
'./blueprints/*/index.js',
41+
'./config/**/*.js',
42+
'./lib/**/*.js',
43+
'./node-tests/**/*.js',
44+
'./tests/dummy/config/**/*.js',
3145
],
3246
parserOptions: {
33-
sourceType: 'script'
47+
sourceType: 'script',
3448
},
3549
env: {
3650
browser: false,
37-
node: true
51+
node: true,
3852
},
3953
plugins: ['node'],
40-
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
41-
// add your custom rules and overrides for node files here
42-
})
43-
}
44-
]
54+
extends: ['plugin:node/recommended'],
55+
rules: {
56+
'ember/avoid-leaking-state-in-ember-objects': 'off',
57+
'node/no-extraneous-require': ['error', {
58+
allowModules: ['ember-source-channel-url']
59+
}],
60+
'node/no-unpublished-require': ['error', {
61+
allowModules: ['ember-cli']
62+
}]
63+
}
64+
},
65+
],
4566
};

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ jobs:
2323
with:
2424
node-version: 14.x
2525
cache: yarn
26+
2627
- name: Install Dependencies
2728
run: yarn install --frozen-lockfile
28-
# - name: Lint
29-
# run: yarn lint
29+
30+
- name: Lint
31+
run: yarn lint
32+
3033
- name: Run Tests
3134
run: yarn test
3235

@@ -40,8 +43,10 @@ jobs:
4043
with:
4144
node-version: 14.x
4245
cache: yarn
46+
4347
- name: Install Dependencies
4448
run: yarn install --no-lockfile
49+
4550
- name: Run Tests
4651
run: yarn test
4752

@@ -72,7 +77,9 @@ jobs:
7277
with:
7378
node-version: 14.x
7479
cache: yarn
80+
7581
- name: Install Dependencies
7682
run: yarn install --frozen-lockfile
83+
7784
- name: Run Tests
7885
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/bower_components
1010

1111
# misc
12+
/.eslintcache
1213
/.sass-cache
1314
/connect.lock
1415
/coverage/*

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,24 @@
1414
"repository": "https://github.com/ember-engines/ember-asset-loader",
1515
"scripts": {
1616
"build": "ember build",
17+
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
18+
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
19+
"lint:js": "eslint . --cache",
20+
"lint:js:fix": "eslint . --fix",
1721
"start": "ember server",
1822
"test": "ember test",
1923
"test:sauce": "ember test --config-file testem.sauce.js --test-port 7000",
2024
"test:node": "mocha node-tests",
2125
"prepublish": "./bin/install-test-addons.sh"
2226
},
2327
"devDependencies": {
28+
"@babel/eslint-parser": "^7.17.0",
29+
"@babel/plugin-proposal-decorators": "^7.17.9",
2430
"broccoli-asset-rev": "^3.0.0",
2531
"broccoli-test-helper": "^2.0.0",
2632
"co": "^4.6.0",
2733
"ember-cli": "~3.12.0",
2834
"ember-cli-dependency-checker": "^3.1.0",
29-
"ember-cli-eslint": "^5.1.0",
3035
"ember-cli-htmlbars": "^3.0.1",
3136
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
3237
"ember-cli-inject-live-reload": "^2.0.1",
@@ -40,9 +45,12 @@
4045
"ember-resolver": "^5.1.3",
4146
"ember-source": "~3.12.0",
4247
"ember-try": "^2.0.0",
43-
"eslint-plugin-node": "^11.0.0",
48+
"eslint": "^8.13.0",
49+
"eslint-plugin-ember": "^10.6.0",
50+
"eslint-plugin-node": "^11.1.0",
4451
"loader.js": "^4.7.0",
4552
"mocha": "^6.0.2",
53+
"npm-run-all": "^4.1.5",
4654
"test-generator-plugin": "link:./tests/dummy/lib/test-generator-plugin"
4755
},
4856
"dependencies": {

testem.sauce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*jshint node:true*/
1+
/* eslint-env node */
22
module.exports = {
33
"framework": "qunit",
44
"test_page": "tests/index.html?hidepassed",

tests/.eslintrc.js

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

tests/dummy/config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function(environment) {
4545
}
4646

4747
if (environment === 'production') {
48-
48+
// here you can enable a production-specific feature
4949
}
5050

5151
return ENV;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/*jshint node:true*/
1+
/* eslint-env node */
22
var ManifestGenerator = require('../../../../lib/manifest-generator');
33

44
module.exports = ManifestGenerator.extend({
55
name: 'test-generator-plugin',
66

7-
manifestOptions: {
7+
manifestOptions: Object.freeze({
88
bundlesLocation: 'test-dist',
99
supportedTypes: [ 'js', 'css' ]
10-
}
10+
})
1111
});

tests/dummy/public/test-dist/loaded-asset-state/loaded-asset-state.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global define */
12
define('loaded-asset-state', function() {
23
return {
34
default: 'you should reset me'

0 commit comments

Comments
 (0)