Skip to content

Commit

Permalink
Merge pull request #9009 from dcyriller/rfc-121
Browse files Browse the repository at this point in the history
Use `eslint` and `ember-template-lint` directly (no longer lint during builds/rebuilds by default)
  • Loading branch information
rwjblue committed Feb 24, 2020
2 parents 4bc79f8 + 754504c commit 1dd8f4b
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 41 deletions.
7 changes: 3 additions & 4 deletions blueprints/addon/files/.travis.yml
Expand Up @@ -38,17 +38,16 @@ jobs:
- stage: "Tests"
name: "Tests"
script:
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:hbs
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:js
- <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> test:ember

- stage: "Additional Tests"
name: "Floating Dependencies"
install:<% if (yarn) { %>
- yarn install --no-lockfile --non-interactive<% } else { %>
- npm install --no-package-lock<% } %>
script:
- <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
Expand Down
4 changes: 2 additions & 2 deletions blueprints/addon/index.js
Expand Up @@ -80,8 +80,8 @@ module.exports = {
// add ember-source-channel-url
contents.devDependencies['ember-source-channel-url'] = '^2.0.1';

// add `ember-try` as `test:all` script in addons
contents.scripts['test:all'] = 'ember try:each';
// add `ember-compatibility` script in addons
contents.scripts['test:ember-compatibility'] = 'ember try:each';

contents['ember-addon'] = contents['ember-addon'] || {};
contents['ember-addon'].configPath = 'tests/dummy/config';
Expand Down
2 changes: 0 additions & 2 deletions blueprints/app/files/.travis.yml
Expand Up @@ -32,6 +32,4 @@ install:
- yarn install --non-interactive
<% } %>
script:
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:hbs
- <% if (yarn) { %>yarn<% } else { %>npm run<% } %> lint:js
- <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
11 changes: 7 additions & 4 deletions blueprints/app/files/package.json
Expand Up @@ -12,10 +12,12 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
Expand All @@ -28,11 +30,9 @@
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.17.2",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-data": "~3.17.0-beta.0",
"ember-export-application-global": "^2.0.1",
Expand All @@ -41,11 +41,14 @@
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-source": "~3.17.0-beta.1<% if (welcome) { %>",
"ember-source": "~3.17.0-beta.1",
"ember-template-lint": "^2.0.0<% if (welcome) { %>",
"ember-welcome-page": "^4.0.0<% } %>",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion tests/acceptance/smoke-test-slow.js
Expand Up @@ -139,7 +139,6 @@ describe('Acceptance: smoke-test', function() {
let output = result.output.join(EOL);

expect(exitCode).to.equal(0, 'exit code should be 0 for passing tests');
expect(output).to.match(/ESLint/, 'ESLint should be run on production assets');
expect(output).to.match(/fail\s+0/, 'no failures');
expect(output).to.match(/pass\s+\d+/, 'many passing');
});
Expand Down
7 changes: 3 additions & 4 deletions tests/fixtures/addon/npm/.travis.yml
Expand Up @@ -35,16 +35,15 @@ jobs:
- stage: "Tests"
name: "Tests"
script:
- npm run lint:hbs
- npm run lint:js
- npm test
- npm run lint
- npm run test:ember

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- npm install --no-package-lock
script:
- npm test
- npm run test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
Expand Down
11 changes: 7 additions & 4 deletions tests/fixtures/addon/npm/package.json
Expand Up @@ -14,11 +14,13 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each"
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"ember-cli-babel": "^7.17.2",
Expand All @@ -33,10 +35,8 @@
"ember-auto-import": "^1.5.3",
"ember-cli": "~<%= emberCLIVersion %>",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
Expand All @@ -46,10 +46,13 @@
"ember-resolver": "^7.0.0",
"ember-source": "~3.17.0-beta.1",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.0.0",
"ember-try": "^1.4.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0"
},
"engines": {
Expand Down
7 changes: 3 additions & 4 deletions tests/fixtures/addon/yarn/.travis.yml
Expand Up @@ -34,16 +34,15 @@ jobs:
- stage: "Tests"
name: "Tests"
script:
- yarn lint:hbs
- yarn lint:js
- yarn test
- yarn lint
- yarn test:ember

- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- yarn test
- yarn test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
Expand Down
11 changes: 7 additions & 4 deletions tests/fixtures/addon/yarn/package.json
Expand Up @@ -14,11 +14,13 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each"
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"ember-cli-babel": "^7.17.2",
Expand All @@ -33,10 +35,8 @@
"ember-auto-import": "^1.5.3",
"ember-cli": "~<%= emberCLIVersion %>",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.1",
Expand All @@ -46,11 +46,14 @@
"ember-resolver": "^7.0.0",
"ember-source": "~3.17.0-beta.1",
"ember-source-channel-url": "^2.0.1",
"ember-template-lint": "^2.0.0",
"ember-try": "^1.4.0",
"ember-welcome-page": "^4.0.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0"
},
"engines": {
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/app/npm/.travis.yml
Expand Up @@ -22,6 +22,4 @@ branches:
- master

script:
- npm run lint:hbs
- npm run lint:js
- npm test
9 changes: 6 additions & 3 deletions tests/fixtures/app/npm/package.json
Expand Up @@ -12,10 +12,12 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
Expand All @@ -28,11 +30,9 @@
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.17.2",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-data": "~3.17.0-beta.0",
"ember-export-application-global": "^2.0.1",
Expand All @@ -42,9 +42,12 @@
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-source": "~3.17.0-beta.1",
"ember-template-lint": "^2.0.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0"
},
"engines": {
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/app/yarn/.travis.yml
Expand Up @@ -28,6 +28,4 @@ install:
- yarn install --non-interactive

script:
- yarn lint:hbs
- yarn lint:js
- yarn test
9 changes: 6 additions & 3 deletions tests/fixtures/app/yarn/package.json
Expand Up @@ -12,10 +12,12 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test"
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test"
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
Expand All @@ -28,11 +30,9 @@
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.17.2",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-template-lint": "^1.0.0-beta.3",
"ember-cli-uglify": "^3.0.0",
"ember-data": "~3.17.0-beta.0",
"ember-export-application-global": "^2.0.1",
Expand All @@ -42,10 +42,13 @@
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-source": "~3.17.0-beta.1",
"ember-template-lint": "^2.0.0",
"ember-welcome-page": "^4.0.0",
"eslint": "^6.8.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/blueprints/addon-test.js
Expand Up @@ -76,7 +76,7 @@ describe('blueprint - addon', function() {
"ember-addon"\n\
],\n\
"scripts": {\n\
"test:all": "ember try:each"\n\
"test:ember-compatibility": "ember try:each"\n\
},\n\
"dependencies": {},\n\
"devDependencies": {\n\
Expand Down Expand Up @@ -172,7 +172,7 @@ describe('blueprint - addon', function() {
);

let json = JSON.parse(output);
expect(json.scripts['test:all']).to.equal('ember try:each');
expect(json.scripts['test:ember-compatibility']).to.equal('ember try:each');
});

it('overwrites `ember-addon.configPath`', function() {
Expand Down

0 comments on commit 1dd8f4b

Please sign in to comment.