Skip to content

Commit

Permalink
feat: use npm + improve test and lint configuration + upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorsalgado committed Dec 6, 2021
1 parent 3ab1249 commit 4b27404
Show file tree
Hide file tree
Showing 13 changed files with 54,518 additions and 23,199 deletions.
30 changes: 23 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc'],
extends: [
'plugin:@typescript-eslint/recommended',
'standard',
'prettier'
],
extends: ['plugin:@typescript-eslint/recommended', 'standard', 'prettier'],
env: {
jest: true,
node: true
Expand All @@ -14,7 +10,7 @@ module.exports = {
'tsdoc/syntax': 'error',

'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],

'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
Expand All @@ -29,6 +25,26 @@ module.exports = {
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': ['error'],

'@typescript-eslint/ban-types': ['warn']
'@typescript-eslint/ban-types': ['warn'],
'@typescript-eslint/no-inferrable-types': ['off'],

'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object']
}
],
'import/no-named-as-default': ['off'],
'import/no-duplicates': ['off'],
'import/no-mutable-exports': ['error'],
'import/no-useless-path-segments': [
'error',
{
noUselessIndex: true
}
],
'import/no-self-import': ['error'],
'import/export': ['error'],
'import/no-deprecated': ['error']
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ typings/
.idea/
.nvmrc
.npmrc
package-lock.json
.yarn/
temp/
yarn.lock
.yarnrc.yml

# Dist
dist/
Expand Down
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

29 changes: 0 additions & 29 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.0.cjs

This file was deleted.

13 changes: 0 additions & 13 deletions .yarnrc.yml

This file was deleted.

19 changes: 19 additions & 0 deletions jest-base.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Config as JestConfig } from '@jest/types'

const config: JestConfig.InitialOptions = {
verbose: true,
collectCoverage: false,
resetModules: true,
restoreMocks: true,
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
transform: { '^.+\\.tsx?$': 'ts-jest' },
globals: {
'ts-jest': {
tsconfig: '../../tsconfig.test.json'
}
},
coveragePathIgnorePatterns: ['/dist/', '<rootDit>/dist', '/node_modules/', '<rootDir>/examples'],
testPathIgnorePatterns: ['/dist/', '<rootDit>/dist', '/node_modules/', '<rootDir>/examples']
}

export default config
7 changes: 4 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const config: JestConfig.InitialOptions = {
tsconfig: './tsconfig.test.json'
}
},
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
collectCoverageFrom: [
'**/pkgs/*/**/*.ts',
'!**/pkgs/*/**/*.js',
Expand All @@ -27,7 +28,7 @@ const config: JestConfig.InitialOptions = {
],
coveragePathIgnorePatterns: [
'drizzle-http-fetch/src/test',
'drizzle-http-core/src/internal/http/test',
'drizzle-http-core/src/internal/net/http/test',
'/node_modules/'
],
modulePathIgnorePatterns: [
Expand All @@ -39,7 +40,7 @@ const config: JestConfig.InitialOptions = {
'pkgs/.*/dist',
'pkgs/.*/out',
'pkgs/.*/tsconfig.*',
'internal/clinic/*'
'pkgs/clinic/*'
],
testPathIgnorePatterns: [
'/node_modules/',
Expand All @@ -48,7 +49,7 @@ const config: JestConfig.InitialOptions = {
'/dist/',
'/out/',
'/pkgs/.*/dist',
'internal/clinic/*',
'pkgs/clinic/*',
'/scripts/'
]
}
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"npmClient": "npm",
"packages": [
"benchmarks",
"internal/*",
"pkgs/*",
"examples/*"
],
Expand Down
Loading

0 comments on commit 4b27404

Please sign in to comment.