Skip to content

Commit

Permalink
version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stagas committed Jan 30, 2022
1 parent 277e442 commit c998239
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 22,607 deletions.
25 changes: 9 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,25 @@ module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'html-jsx'],
ignorePatterns: ['dist', 'node_modules'],
plugins: ['import'],
settings: {
react: {
pragma: 'h',
fragment: 'Fragment',
version: '17',
},
},
rules: {
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'all', argsIgnorePattern: '^_' },
],
'no-fallthrough': 'error'
'@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': 'off',
'no-cond-assign': 'off',
},
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
coverage
dist
node_modules
package-lock.json
.swc
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"useTabs": false,
"semi": false,
"singleQuote": true,
"printWidth": 120,
"printWidth": 100,
"trailingComma": "es5",
"arrowParens": "avoid"
}
19 changes: 19 additions & 0 deletions .pull-configs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { pullConfigs } = require('pull-configs')

const local = __dirname + '/'
const remote = 'https://github.com/stagas/typescript-minimal-template/raw/main/'

const { assign, omit, sort, merge, replace } = pullConfigs(remote, local)

merge('package.json', (prev, next) => {
assign(prev.scripts, omit(next.scripts, ['test', 'build:min']))
sort(assign(prev.devDependencies, next.devDependencies))
})
replace('.gitignore')
replace('.eslintrc.js')
replace('.prettierrc')
replace('jest.config.js')
replace('tsconfig.json')
replace('tsconfig.dist.json')
replace('web-test-runner.config.js')
merge('.vscode/settings.json')
13 changes: 0 additions & 13 deletions .vscode/extensions.json

This file was deleted.

32 changes: 5 additions & 27 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
{
"files.exclude": {
".husky": true,
".npmrc": true,
".gitignore": true,
".gitattributes": true,
".prettierignore": true,
"coverage": true
},
"auto-run-command.rules": [
{
"condition": [
"hasFile: coverage/lcov.info"
],
"command": "coverage-gutters.watchCoverageAndVisibleEditors",
"message": "Running coverage"
}
],
"restoreTerminals.terminals": [
{
"splitTerminals": [
{
"name": "coverage",
"commands": [
"npm run cov:watch"
]
},
{
"name": "zsh",
"commands": []
}
]
},
],
"todo-tree.tree.scanMode": "workspace only",
"npm-scripts.showStartNotification": false,
"typescript.tsdk": "node_modules/typescript/lib"
"npm-scripts.showStartNotification": false
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ npm i with-properties

### withProperties

[src/index.ts:61-97](https://github.com/stagas/with-properties/blob/09b9dfbc39651dedc05a521ed6013a49d49411fd/src/index.ts#L61-L97 "Source code on GitHub")
[src/index.ts:61-99](https://github.com/stagas/with-properties/blob/277e44260244869a3c7582b1a6b65521ab039b55/src/index.ts#L61-L99 "Source code on GitHub")

Creates a base class extending another class and mixins a property
accessors class that is added to the `observedAttributes` list with
Expand Down
31 changes: 28 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
module.exports = {
testEnvironment: 'jsdom',
rootDir: 'src',
testEnvironment: 'jsdom', // or node
rootDir: '.',
roots: ['<rootDir>/test/', '<rootDir>/src'],
testMatch: ['**/*.spec.{js,jsx,ts,tsx}'],
coverageDirectory: '../coverage',
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/test/web/'],
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
coverageProvider: 'v8',

// enable this for real typescript builds (slow but accurate)
// preset: 'ts-jest',

// enable this for fast, correct sourcemaps but not all features supported
transform: {
'\\.(js|jsx|ts|tsx)$': [
'@stagas/sucrase-jest-plugin',
Expand All @@ -14,4 +23,20 @@ module.exports = {
},
],
},

// enable this for fast, incorrect sourcemaps but more features supported

// transform: {
// '\\.(js|jsx|ts|tsx)$': [
// '@swc-node/jest',
// {
// experimentalDecorators: true,
// emitDecoratorMetadata: true,
// react: {
// pragma: 'h',
// pragmaFrag: 'Fragment',
// },
// },
// ],
// },
}
Loading

0 comments on commit c998239

Please sign in to comment.