Skip to content

Commit

Permalink
Merge pull request #135 from ember-engines/travis-to-gh-actions
Browse files Browse the repository at this point in the history
replace ember-cli-eslint with eslint
  • Loading branch information
SergeAstapov authored May 19, 2022
2 parents 75296d3 + aca93e1 commit 88f8980
Show file tree
Hide file tree
Showing 11 changed files with 877 additions and 285 deletions.
25 changes: 25 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
71 changes: 46 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
},
},
extends: 'eslint:recommended',
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
],
env: {
browser: true
browser: true,
},
rules: {
'ember/new-module-imports': 'off',
'ember/no-get': 'off',
'ember/no-private-routing-service': 'off'
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/**/*.js',
'./node-tests/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
extends: ['plugin:node/recommended'],
rules: {
'ember/avoid-leaking-state-in-ember-objects': 'off',
'node/no-extraneous-require': ['error', {
allowModules: ['ember-source-channel-url']
}],
'node/no-unpublished-require': ['error', {
allowModules: ['ember-cli']
}]
}
},
],
};
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
with:
node-version: 14.x
cache: yarn

- name: Install Dependencies
run: yarn install --frozen-lockfile
# - name: Lint
# run: yarn lint

- name: Lint
run: yarn lint

- name: Run Tests
run: yarn test

Expand All @@ -40,8 +43,10 @@ jobs:
with:
node-version: 14.x
cache: yarn

- name: Install Dependencies
run: yarn install --no-lockfile

- name: Run Tests
run: yarn test

Expand Down Expand Up @@ -72,7 +77,9 @@ jobs:
with:
node-version: 14.x
cache: yarn

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/bower_components

# misc
/.eslintcache
/.sass-cache
/connect.lock
/coverage/*
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@
"repository": "https://github.com/ember-engines/ember-asset-loader",
"scripts": {
"build": "ember build",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember server",
"test": "ember test",
"test:sauce": "ember test --config-file testem.sauce.js --test-port 7000",
"test:node": "mocha node-tests",
"prepublish": "./bin/install-test-addons.sh"
},
"devDependencies": {
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-decorators": "^7.17.9",
"broccoli-asset-rev": "^3.0.0",
"broccoli-test-helper": "^2.0.0",
"co": "^4.6.0",
"ember-cli": "~3.12.0",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^2.0.1",
Expand All @@ -40,9 +45,12 @@
"ember-resolver": "^5.1.3",
"ember-source": "~3.12.0",
"ember-try": "^2.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint": "^8.13.0",
"eslint-plugin-ember": "^10.6.0",
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"mocha": "^6.0.2",
"npm-run-all": "^4.1.5",
"test-generator-plugin": "link:./tests/dummy/lib/test-generator-plugin"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion testem.sauce.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*jshint node:true*/
/* eslint-env node */
module.exports = {
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
Expand Down
5 changes: 0 additions & 5 deletions tests/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(environment) {
}

if (environment === 'production') {

// here you can enable a production-specific feature
}

return ENV;
Expand Down
6 changes: 3 additions & 3 deletions tests/dummy/lib/test-generator-plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*jshint node:true*/
/* eslint-env node */
var ManifestGenerator = require('../../../../lib/manifest-generator');

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

manifestOptions: {
manifestOptions: Object.freeze({
bundlesLocation: 'test-dist',
supportedTypes: [ 'js', 'css' ]
}
})
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global define */
define('loaded-asset-state', function() {
return {
default: 'you should reset me'
Expand Down
Loading

0 comments on commit 88f8980

Please sign in to comment.