Skip to content

Commit

Permalink
feature: rewrite in mixter
Browse files Browse the repository at this point in the history
  • Loading branch information
stagas committed Apr 14, 2022
1 parent 6b02b96 commit 85d6881
Show file tree
Hide file tree
Showing 30 changed files with 1,458 additions and 395 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ module.exports = {
ecmaVersion: 2021,
sourceType: 'module',
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'html-jsx'],
ignorePatterns: ['dist', 'node_modules'],
plugins: ['import'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@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-this-alias': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'@typescript-eslint/no-var-requires': 'off',
'no-cond-assign': 'off',
'no-empty': 'off',
},
}
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
* -linguist-detectable
bench/** linguist-detectable
src/** linguist-detectable
example/** linguist-detectable
test/** linguist-detectable
types/** linguist-detectable
*.ts linguist-language=TypeScript

*.html -linguist-detectable
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ coverage
dist
node_modules
package-lock.json
.swc
2 changes: 1 addition & 1 deletion .husky/pre-commit → .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
npm run prepush
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

57 changes: 57 additions & 0 deletions .pull-configs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const fs = require('fs')
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) => {
prev.trustedDependencies ??= []
prev.trustedDependencies = [
...new Set([...prev.trustedDependencies, ...(next.trustedDependencies ?? [])]),
].sort()
prev.types = next.types
prev.scripts = next.scripts
prev.files = next.files
sort(assign(prev.devDependencies, next.devDependencies))

// deprecated
delete prev.devDependencies['@stagas/documentation-fork']
delete prev.devDependencies['@rollup/plugin-commonjs']
delete prev.devDependencies['@stagas/sucrase-jest-plugin']
delete prev.devDependencies['@web/dev-server-esbuild']
delete prev.devDependencies['@web/dev-server-rollup']
delete prev.devDependencies['esbuild']
delete prev.devDependencies['esbuild-register']
delete prev.devDependencies['prettier']
delete prev.devDependencies['terser']
delete prev.devDependencies['vite-web-test-runner-plugin']
})
replace('.gitattributes')
replace('.gitignore')
replace('.npmrc')
replace('.eslintrc.js')
replace('.pull-configs.js')
replace('.swcrc')
replace('dprint.json')
replace('jest.config.js')
replace('tsconfig.json')
replace('tsconfig.dist.json')
replace('web-test-runner.config.js')
replace('LICENSE')

const deprecated = [
'.vscode/extensions.json',
'.vscode',
'.prettierrc',
'.prettierignore',
'example/tsconfig.json',
'vite.config.js',
]
deprecated.forEach(x => {
try {
fs.rmSync(x, { recursive: true })
console.log('removed', x)
} catch {}
})
23 changes: 23 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"jsc": {
"target": "es2022",
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": true,
"dynamicImport": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true,
"useDefineForClassFields": true,
"react": {
"runtime": "automatic"
},
"hidden": {
"jest": true
}
},
"keepClassNames": true
}
}
13 changes: 0 additions & 13 deletions .vscode/extensions.json

This file was deleted.

33 changes: 0 additions & 33 deletions .vscode/settings.json

This file was deleted.

7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2022 stagas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 changes: 30 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"indentWidth": 2,
"incremental": true,
"typescript": {
"arguments.trailingCommas": "never",
"arrowFunction.useParentheses": "preferNone",
"jsx.quoteStyle": "preferDouble",
"quoteProps": "asNeeded",
"quoteStyle": "alwaysSingle",
"semiColons": "asi",
"useBraces": "preferNone"
},
"json": {},
"markdown": {},
"includes": [
"**/*.{ts,tsx,js,jsx,cjs,mjs,json,md}"
],
"excludes": [
"node_modules/**/*",
"coverage/**/*",
"dist/**/*",
".swc/**/*",
".vscode/**/*"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.64.2.wasm",
"https://plugins.dprint.dev/json-0.14.1.wasm",
"https://plugins.dprint.dev/markdown-0.12.2.wasm"
]
}
Loading

0 comments on commit 85d6881

Please sign in to comment.