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 all 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
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist: trusty
language: node_js
node_js:
- '10'
- '8'
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 @@ -43,3 +45,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.
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"
}
}
11 changes: 10 additions & 1 deletion 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,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
};
60 changes: 29 additions & 31 deletions tests/baseEslintConfig.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
const path = require('path')
const path = require('path');

module.exports = (dirname) => ({
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'import'
module.exports = dirname => ({
env: {
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['import'],
rules: {
'import/no-unresolved': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
rules: {
'import/no-unresolved': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
settings: {
'import/resolver': {
[path.resolve(`${__dirname}/../index.js`)]: {
directory: dirname,
},
},
},
settings: {
'import/resolver': {
[path.resolve(`${__dirname}/../index.js`)]: {
directory: dirname,
},
},
})
},
});