Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
fix(deps): bump configurations, use resolutions to simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Sep 22, 2019
1 parent 702f390 commit 5eb4874
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: build, lint, test
run: |
yarn --frozen-lockfile
yarn lint
yarn build
yarn lint
yarn eslint -f friendly tests/**/*.{ts,tsx}
env:
CI: true
Expand Down
28 changes: 16 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
"engines": {
"node": ">=4"
},
"main": "lib/cjs.js",
"module": "lib/index.js",
"fesm5": "lib/esm.js",
"es2015": "lib/es2015.js",
"types": "lib/index.d.ts",
"main": "lib/cjs",
"module": "lib",
"fesm5": "lib/esm",
"es2015": "lib/es2015",
"types": "lib",
"files": [
"lib"
],
"scripts": {
"build": "rimraf lib && tsc -b src && r",
"build:ts": "tsc -b src",
"build:bundle": "r",
"build": "run-p build:*",
"lint": "eslint --ext md,js,ts -f friendly --ignore-pattern tests .",
"pretest": "r",
"test": "eslint -f friendly tests/**/*.{ts,tsx}",
"type-coverage": "type-coverage --cache --ignore-catch --detail --strict"
},
Expand All @@ -42,14 +43,14 @@
"tsconfig-paths": "^3.9.0"
},
"devDependencies": {
"@1stg/babel-preset": "^0.6.2",
"@1stg/babel-preset": "^0.7.0",
"@1stg/commitlint-config": "^0.1.0",
"@1stg/eslint-config": "^0.12.1",
"@1stg/eslint-config": "^0.12.10",
"@1stg/husky-config": "^0.3.0",
"@1stg/lint-staged": "^0.6.1",
"@1stg/lint-staged": "^0.7.4",
"@1stg/prettier-config": "^0.2.0",
"@1stg/remark-config": "^0.2.1",
"@1stg/rollup-config": "^0.9.4",
"@1stg/rollup-config": "^0.9.5",
"@1stg/tsconfig": "^0.5.1",
"@babel/core": "^7.6.0",
"@commitlint/cli": "^8.2.0",
Expand All @@ -64,11 +65,14 @@
"lint-staged": "^9.2.5",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"rimraf": "^3.0.0",
"react": "^16.9.0",
"rollup": "^1.21.4",
"type-coverage": "^2.3.0",
"typescript": "^3.6.3"
},
"resolutions": {
"eslint-import-resolver-ts": "link:."
},
"typeCoverage": {
"atLeast": 100
}
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ function getMappedPath(source: string, file: string) {
.map(mapper => mapper(source, file))
.filter(path => !!path)

// eslint-disable-next-line @typescript-eslint/no-magic-numbers
if (paths.length > 1) {
log('found multiple matching ts paths:', paths)
}
Expand Down Expand Up @@ -191,7 +190,6 @@ function mangleScopedPackage(moduleName: string) {
if (moduleName.startsWith('@')) {
const replaceSlash = moduleName.replace(path.sep, '__')
if (replaceSlash !== moduleName) {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
return replaceSlash.slice(1) // Take off the "@"
}
}
Expand Down
8 changes: 3 additions & 5 deletions tests/baseEslintConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const path = require('path')

module.exports = dirname => ({
module.exports = directory => ({
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
Expand All @@ -11,8 +9,8 @@ module.exports = dirname => ({
],
settings: {
'import/resolver': {
[path.resolve(__dirname, '../lib/cjs.js')]: {
directory: dirname,
ts: {
directory,
alwaysTryTypes: true,
},
},
Expand Down

0 comments on commit 5eb4874

Please sign in to comment.