Skip to content

Commit

Permalink
Fix: ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roman.vasilev committed Jul 1, 2018
1 parent de14fc3 commit c5f60fb
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 11 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"main": "dist/index.js",
"typings": "src/index.ts",
"scripts": {
"t": "npm run mocha -- src/*.spec.ts",
"test": "npm run eslint && npm run tscheck && npm run t",
"test": "npm run eslint && npm run tscheck && npm run test:r",
"test:r": "npm run mocha -- src/*.spec.ts",
"mocha": "node -r ts-node/register/transpile-only node_modules/mocha/bin/_mocha",
"test:w": "npm run mocha -- --watch-extensions ts --watch src/**/*.spec.ts",
Expand Down
20 changes: 11 additions & 9 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as assert from 'assert';
import * as lib from './index';

const root = process.cwd();

let service: ReturnType<typeof lib.createService>;

it('smoke', () => {
Expand All @@ -10,13 +12,13 @@ it('smoke', () => {
describe('create service', () => {

before(() => {
const configFile = `${__dirname}/test-project/tsconfig.json`;
const configFile = `${root}/test-project/tsconfig.json`;
service = lib.createService({ configFile });
assert(service);
});

it('errors', () => {
const testFile = `${__dirname}/test-project/errors.ts`;
const testFile = `${root}/test-project/errors.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -27,7 +29,7 @@ describe('create service', () => {
});

it('number', () => {
const testFile = `${__dirname}/test-project/number.ts`;
const testFile = `${root}/test-project/number.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -36,7 +38,7 @@ describe('create service', () => {
});

it('built in', () => {
const testFile = `${__dirname}/test-project/builtin.ts`;
const testFile = `${root}/test-project/builtin.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -45,7 +47,7 @@ describe('create service', () => {
});

it('types', () => {
const testFile = `${__dirname}/test-project/types.ts`;
const testFile = `${root}/test-project/types.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -54,7 +56,7 @@ describe('create service', () => {
});

it('decorator', () => {
const testFile = `${__dirname}/test-project/decorator.ts`;
const testFile = `${root}/test-project/decorator.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -63,7 +65,7 @@ describe('create service', () => {
});

it('global types', () => {
const testFile = `${__dirname}/test-project/global-types.ts`;
const testFile = `${root}/test-project/global-types.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -72,7 +74,7 @@ describe('create service', () => {
});

it('date', () => {
const testFile = `${__dirname}/test-project/date.ts`;
const testFile = `${root}/test-project/date.ts`;
service.update({ fileName: testFile });
const sourceFile = service.getProgram().getSourceFile(testFile);
assert(sourceFile);
Expand All @@ -83,7 +85,7 @@ describe('create service', () => {
});

it('create service no libs', () => {
const configFile = `${__dirname}/test-project/tsconfig-nolibs.json`;
const configFile = `${root}/test-project/tsconfig-nolibs.json`;
service = lib.createService({ configFile });
assert(service);
});
14 changes: 14 additions & 0 deletions test-project/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
'root': true,
'env': {
'es6': true,
'node': true
},
'parser': 'typescript-eslint-parser',
'parserOptions': {
'ecmaVersion': 2017,
'sourceType': 'module'
},
'rules': {
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c5f60fb

Please sign in to comment.