Skip to content

Commit

Permalink
deps!: update to new linting rules (#1164)
Browse files Browse the repository at this point in the history
Updates all deps to the latest versions. Includes new linting rules from
`eslint-config-ipfs` that require return types on all methods to prevent
tsc creating verbose derived types when we normally meant to specify
that a function returns an interface.

- ipfs/eslint-config-ipfs#114
- ipfs/eslint-config-ipfs#110

BREAKING CHANGE: all functions and methods need to declare a return type
  • Loading branch information
achingbrain authored Jan 12, 2023
1 parent 08e46ce commit cf77bbb
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,19 +256,19 @@
"electron-mocha-main": "^11.0.3",
"env-paths": "^3.0.0",
"esbuild": "^0.16.1",
"eslint": "^7.32.0",
"eslint-config-ipfs": "^2.1.0",
"eslint-plugin-etc": "^1.1.7",
"eslint": "^8.31.0",
"eslint-config-ipfs": "^3.1.2",
"eslint-plugin-etc": "^2.0.2",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jsdoc": "^36.0.8",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-promise": "^6.1.1",
"execa": "^6.1.0",
"extract-zip": "^2.0.1",
"fs-extra": "^11.1.0",
"gh-pages": "^4.0.0",
"globby": "^13.1.1",
"it-glob": "^1.0.1",
"it-glob": "^2.0.0",
"kleur": "^4.1.4",
"lilconfig": "^2.0.5",
"listr": "~0.14.2",
Expand Down Expand Up @@ -301,13 +301,13 @@
"react-native-test-runner": "^5.0.0",
"read-pkg-up": "^9.1.0",
"rimraf": "^3.0.2",
"semantic-release": "^19.0.2",
"semantic-release": "^20.0.2",
"semantic-release-monorepo": "^7.0.5",
"semver": "^7.3.8",
"source-map-support": "^0.5.20",
"strip-bom": "^5.0.0",
"strip-json-comments": "^5.0.0",
"tempy": "^2.0.0",
"tempy": "^3.0.0",
"typedoc": "^0.23.21",
"typedoc-plugin-mdn-links": "^2.0.0",
"typedoc-plugin-missing-exports": "^1.0.0",
Expand All @@ -325,7 +325,7 @@
"@types/cors": "^2.8.10",
"@types/diff": "^5.0.2",
"@types/eslint": "^8.4.1",
"@types/fs-extra": "^9.0.10",
"@types/fs-extra": "^11.0.1",
"@types/gh-pages": "^3.0.0",
"@types/listr": "^0.14.2",
"@types/pascalcase": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/test/node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execa } from 'execa'
import path from 'path'
import tempy from 'tempy'
import * as tempy from 'tempy'
import merge from 'merge-options'
import { fileURLToPath } from 'url'

Expand All @@ -24,7 +24,7 @@ export default async function testNode (argv, execaOptions) {
? [
'--reporter', 'json',
'--report-dir', '.coverage',
'--temp-directory', tempy.directory(),
'--temp-directory', tempy.temporaryDirectory(),
'--clean',
'mocha'
]
Expand Down
40 changes: 40 additions & 0 deletions test/fixtures/js+ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2020",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": false,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"src",
"test"
]
}
4 changes: 2 additions & 2 deletions test/fixtures/projects/a-ts-project/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import derp from 'an-esm-dep'
import type { UsedButNotExported } from './a-module.js'
import type { EventEmitter } from 'node:events'

export const useHerp = () => {
export const useHerp = (): void => {
herp()
}

export const useDerp = () => {
export const useDerp = (): void => {
derp()
}

Expand Down
4 changes: 2 additions & 2 deletions test/utils/set-up-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import fs, { copy } from 'fs-extra'
import path, { join } from 'path'
import tempy from 'tempy'
import * as tempy from 'tempy'
import { fileURLToPath } from 'url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
Expand All @@ -11,7 +11,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
* @param {string} project
*/
export async function setUpProject (project) {
const projectDir = tempy.directory()
const projectDir = tempy.temporaryDirectory()

await copy(join(__dirname, '..', 'fixtures', 'projects', project), projectDir)
const nodeModulesPath = path.resolve(__dirname, '../../node_modules')
Expand Down

0 comments on commit cf77bbb

Please sign in to comment.