Skip to content

[TEST] Add travis #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dist: trusty
language: node_js
node_js:
- '10'
- '8'
- '6'
install: npm i
script:
- npm run check-format
- npm run test
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# eslint-import-resolver-typescript

[![Build Status](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript.svg?branch=master)](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript)

This plugin adds typescript support to [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import).

This means you can:
Expand Down Expand Up @@ -45,3 +47,7 @@ Add the following to your `.eslintrc` config:

- Make sure your change is covered by a test import.
- Make sure that `npm test` passes without a failure.
- Make sure your code is formatted `npm format`.

We have an [automatic travis build](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript) which will run the above on your PRs.
If either fails, we won't be able to merge your PR until it's fixed.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function resolveFile(source, file, config) {
const extensions = Object.keys(require.extensions).concat(
'.ts',
'.tsx',
'.d.ts',
'.d.ts'
);

// setup tsconfig-paths
Expand All @@ -37,7 +37,7 @@ function resolveFile(source, file, config) {
if (configLoaderResult.resultType === 'success') {
const matchPath = tsconfigPaths.createMatchPath(
configLoaderResult.absoluteBaseUrl,
configLoaderResult.paths,
configLoaderResult.paths
);

// look for files based on setup tsconfig "paths"
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
"dummy.js": "file:dummy.js",
"eslint": "^5.6.1",
"eslint-plugin-import": "^2.14.0",
"prettier": "^1.14.3",
"typescript": "^3.1.1"
},
"scripts": {
"test": "eslint ./tests/withPaths/index.ts && eslint ./tests/withoutPaths/index.ts"
"test": "eslint ./tests/withPaths/index.ts && eslint ./tests/withoutPaths/index.ts",
"check-format": "prettier --config prettier.config.js index.js -l",
"format": "prettier --config prettier.config.js index.js --write"
}
}
13 changes: 11 additions & 2 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';

module.exports = {
parser: 'typescript',
arrowParens: 'avoid',
bracketSpacing: true,
parser: 'babylon',
jsxBracketSameLine: true,
proseWrap: 'preserve',
semi: true,
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,
};