Skip to content

Commit

Permalink
Merge branch 'vite'
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Jul 19, 2023
2 parents 94f01dc + 980059e commit c6a6da3
Show file tree
Hide file tree
Showing 26 changed files with 2,933 additions and 8,259 deletions.
49 changes: 0 additions & 49 deletions .babelrc.js

This file was deleted.

52 changes: 15 additions & 37 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

// The nicest rules
const nicest = {
'default-param-last': 1,
eqeqeq: [2, 'allow-null'], // == and != are nice for null+undefined
'import/first': 1,
'no-console': 2, // we want a clean console - eslint-disable every wanted one
'no-implicit-coercion': [2, {allow: ['!!']}], // !! is fun
'no-shadow': 2, // sometimes causes logic bugs.
'no-unused-vars': [
'@typescript-eslint/no-unused-vars': [
'error',
// allow unused vars starting with _
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
},
], // allow unused vars starting with _
],
'default-param-last': 1,
eqeqeq: [2, 'allow-null'], // == and != are nice for null+undefined
'no-console': 2, // we want a clean console - eslint-disable every wanted one
'no-implicit-coercion': [2, {allow: ['!!']}], // !! is fun
'no-shadow': 2, // sometimes causes logic bugs.
'object-shorthand': 2,
'prefer-destructuring': [
2,
Expand All @@ -30,12 +30,14 @@ const nicest = {

// Would be nice to make these error
const maybe = {
'@typescript-eslint/ban-ts-comment': 1,
'no-warning-comments': 1, // set to 0 and remove allowWarning from unicorn rule above
'require-atomic-updates': 1, // too many false positives
}

// these rules suck
const suck = {
'@typescript-eslint/no-explicit-any': 0,
'capitalized-comments': 0,
'no-eq-null': 0,
'no-mixed-operators': 0,
Expand Down Expand Up @@ -69,44 +71,20 @@ module.exports = {
commonjs: true,
es6: true,
node: true,
'vitest-globals/env': true,
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:@typescript-eslint/recommended',
'plugin:vitest-globals/recommended',
'plugin:promise/recommended',
'plugin:unicorn/recommended',
// Keep this last, it overrides all style rules
'plugin:prettier/recommended',
],
ignorePatterns: ['/build/**/*', '/coverage/**/*', '/dist/**/*'],
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
},
{
files: ['**/*.d.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
// don't treat type definitions as unused vars
'@typescript-eslint/no-unused-vars': rules['no-unused-vars'],
'no-undef': 0,
'no-unused-vars': 0,
},
},
],
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
},
plugins: ['jest', 'import', 'promise', 'unicorn', 'jsdoc'],
parser: '@typescript-eslint/parser',
plugins: ['promise', 'unicorn', 'jsdoc', '@typescript-eslint'],
reportUnusedDisableDirectives: true,
rules,
settings: {
jest: {version: '27'},
},
}
1 change: 1 addition & 0 deletions .npsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"config": "./package-scripts.cjs"}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrowParens": "avoid",
"bracketSpacing": false,
"jsdocUseInlineCommentForASingleTagBlock": true,
"plugins": ["./node_modules/@homer0/prettier-plugin-jsdoc"],
"plugins": ["@homer0/prettier-plugin-jsdoc"],
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
Expand Down
16 changes: 8 additions & 8 deletions build-git.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/sh
BUILDDIR=dist
BUILDDIR=lib

function die() {
die() {
echo "!!! $* !!!" >&2
exit 1
}
if ! git diff --quiet; then
die Repo is not clean
fi

CURRENT=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/^\* //'`
ORIGIN=`git config branch.$CURRENT.remote`
CURRENT=$(git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e 's/^\* //')
ORIGIN=$(git config branch."$CURRENT".remote)
if [ -z "$ORIGIN" ]; then
die "Cannot determine origin, are you on a branch?"
fi
if [ $1 ]; then
if [ -n "$1" ]; then
CURRENT=$1
fi
B=${CURRENT}-build
Expand All @@ -26,21 +26,21 @@ fi
if ! nps build; then
die Could not build
fi
if ! git add -f $BUILDDIR API.md; then
if ! git add -f $BUILDDIR; then
die Could not add to commit
fi
if ! git commit -m build; then
die Could not commit
fi

function clean() {
clean() {
# This undoes the last commit but leaves the build in place
git reset HEAD^
}

if ! git push -f "$ORIGIN" "HEAD:$B"; then
clean
die Could not push to $ORIGIN/$B
die Could not push to "$ORIGIN/$B"
fi

if ! clean; then
Expand Down

0 comments on commit c6a6da3

Please sign in to comment.