Skip to content

Commit

Permalink
fix: Fix linting
Browse files Browse the repository at this point in the history
Use the blueprint to update .eslintignore to exclude the electron project's node_modules and our various built output directories
  • Loading branch information
bendemboski committed Nov 21, 2019
1 parent 68e7008 commit ea7ff75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 19 additions & 1 deletion blueprints/ember-electron/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const Blueprint = require('ember-cli/lib/models/blueprint');
const { api } = require('@electron-forge/core');
const chalk = require('chalk');
const { electronProjectPath } = require('../../lib/utils/build-paths');
const {
electronProjectPath,
emberBuildDir,
emberTestBuildDir
} = require('../../lib/utils/build-paths');
const path = require('path');
const denodeify = require('denodeify');
const fs = require('fs');
Expand Down Expand Up @@ -47,6 +51,7 @@ module.exports = class EmberElectronBlueprint extends Blueprint {

async afterInstall() {
await this.updateTravisYml();
await this.updateEslintIgnore();
await this.createElectronProject();
}

Expand Down Expand Up @@ -102,6 +107,19 @@ module.exports = class EmberElectronBlueprint extends Blueprint {
}
}

async updateEslintIgnore() {
const toAppend = [
'',
'# ember-electron',
`/${electronProjectPath}/node_modules/`,
`/${electronProjectPath}/out/`,
`/${electronProjectPath}/${emberBuildDir}/`,
`/${electronProjectPath}/${emberTestBuildDir}/`
].join('\n');

await this.insertIntoFile('.eslintignore', toAppend);
}

async createElectronProject() {
this.ui.writeLine(chalk.green(`Creating electron-forge project at './${electronProjectPath}'`));

Expand Down
4 changes: 4 additions & 0 deletions node-tests/acceptance/end-to-end-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ describe('end-to-end', function() {
});
});

it('lints', async function() {
await expect(run('./node_modules/.bin/eslint', [ '.' ])).to.be.fulfilled;
});

it('extra checks pass', () => {
let fixturePath = path.resolve(__dirname, '..', 'fixtures', 'ember-test');

Expand Down

0 comments on commit ea7ff75

Please sign in to comment.