Skip to content

Commit 04f5d6c

Browse files
Merge pull request #9 from bradzacher/add-travis
[TEST] Add travis
2 parents 989beae + ce64580 commit 04f5d6c

File tree

5 files changed

+58
-33
lines changed

5 files changed

+58
-33
lines changed

Diff for: .travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dist: trusty
2+
language: node_js
3+
node_js:
4+
- '10'
5+
- '8'
6+
install: npm i
7+
script:
8+
- npm run check-format
9+
- npm run test

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# eslint-import-resolver-typescript
22

3+
[![Build Status](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript.svg?branch=master)](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript)
4+
35
This plugin adds typescript support to [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import).
46

57
This means you can:
@@ -43,3 +45,7 @@ Add the following to your `.eslintrc` config:
4345

4446
- Make sure your change is covered by a test import.
4547
- Make sure that `npm test` passes without a failure.
48+
- Make sure your code is formatted `npm format`.
49+
50+
We have an [automatic travis build](https://travis-ci.org/alexgorbatchev/eslint-import-resolver-typescript) which will run the above on your PRs.
51+
If either fails, we won't be able to merge your PR until it's fixed.

Diff for: package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@
3232
"dummy.js": "file:dummy.js",
3333
"eslint": "^5.6.1",
3434
"eslint-plugin-import": "^2.14.0",
35+
"prettier": "^1.14.3",
3536
"typescript": "^3.1.1"
3637
},
3738
"scripts": {
38-
"test": "eslint ./tests/withPaths/index.ts && eslint ./tests/withoutPaths/index.ts"
39+
"test": "eslint ./tests/withPaths/index.ts && eslint ./tests/withoutPaths/index.ts",
40+
"check-format": "prettier --config prettier.config.js index.js -l",
41+
"format": "prettier --config prettier.config.js index.js --write"
3942
}
4043
}

Diff for: prettier.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
'use strict';
2+
13
module.exports = {
2-
parser: 'typescript',
4+
arrowParens: 'avoid',
5+
bracketSpacing: true,
6+
parser: 'babylon',
7+
jsxBracketSameLine: true,
8+
proseWrap: 'preserve',
9+
semi: true,
310
singleQuote: true,
11+
tabWidth: 2,
412
trailingComma: 'all',
13+
useTabs: false,
514
};

Diff for: tests/baseEslintConfig.js

+29-31
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
const path = require('path')
1+
const path = require('path');
22

3-
module.exports = (dirname) => ({
4-
env: {
5-
es6: true,
6-
},
7-
parserOptions: {
8-
ecmaVersion: 2018,
9-
sourceType: 'module',
10-
},
11-
plugins: [
12-
'import'
3+
module.exports = dirname => ({
4+
env: {
5+
es6: true,
6+
},
7+
parserOptions: {
8+
ecmaVersion: 2018,
9+
sourceType: 'module',
10+
},
11+
plugins: ['import'],
12+
rules: {
13+
'import/no-unresolved': 'error',
14+
'import/extensions': [
15+
'error',
16+
'ignorePackages',
17+
{
18+
js: 'never',
19+
jsx: 'never',
20+
ts: 'never',
21+
tsx: 'never',
22+
},
1323
],
14-
rules: {
15-
'import/no-unresolved': 'error',
16-
'import/extensions': [
17-
'error',
18-
'ignorePackages',
19-
{
20-
js: 'never',
21-
jsx: 'never',
22-
ts: 'never',
23-
tsx: 'never',
24-
},
25-
],
26-
},
27-
settings: {
28-
'import/resolver': {
29-
[path.resolve(`${__dirname}/../index.js`)]: {
30-
directory: dirname,
31-
},
32-
},
24+
},
25+
settings: {
26+
'import/resolver': {
27+
[path.resolve(`${__dirname}/../index.js`)]: {
28+
directory: dirname,
29+
},
3330
},
34-
})
31+
},
32+
});

0 commit comments

Comments
 (0)