File tree Expand file tree Collapse file tree 5 files changed +58
-33
lines changed Expand file tree Collapse file tree 5 files changed +58
-33
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+
35This plugin adds typescript support to [ ` eslint-plugin-import ` ] ( https://www.npmjs.com/package/eslint-plugin-import ) .
46
57This 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.
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
13module . 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} ;
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments