Skip to content

Commit

Permalink
Merge pull request #372 from tsaxking/chore-update-scripts-to-bdc09f6…
Browse files Browse the repository at this point in the history
…6a1816b4aabd0a4d43cd99d29314e85a9

Chore update scripts to bdc09f6
  • Loading branch information
tsaxking authored Sep 3, 2024
2 parents 8f6b680 + eeb3901 commit 221716a
Show file tree
Hide file tree
Showing 178 changed files with 8,639 additions and 8,079 deletions.
91 changes: 0 additions & 91 deletions .eslintrc

This file was deleted.

172 changes: 165 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: './tsconfig.json',
extraFileExtensions: ['.svelte'] // This is a required setting in `@typescript-eslint/parser` v4.24.0.
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
// Parse the `<script>` in `.svelte` as TypeScript by adding the following configuration.
parserOptions: {
parser: '@typescript-eslint/parser'
},
rules: {
'no-self-assign': 'off',
'no-duplicate-imports': 'off',
'no-undef': 'off'
}
},
{
files: ['*.ts'],
rules: {
'no-undef': 'off'
}
}
],
plugins: ['@typescript-eslint', 'svelte'],
root: true,

// rules
Expand All @@ -10,13 +35,146 @@ module.exports = {
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
]
},
],
semi: ['error', 'always'],
quotes: ['warn', 'single'],
'array-callback-return': 'error',
'constructor-super': 'error',
'for-direction': 'error',
'getter-return': 'error',
'no-array-constructor': 'error',
'no-async-promise-executor': 'error',
'no-await-in-loop': 'warn',
'no-class-assign': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-constant-binary-expression': 'error',
'no-constant-condition': 'error',
'no-constructor-return': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'warn',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-fallthrough': 'error',
'no-func-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'warn',
'no-loss-of-precision': 'error',
'no-misleading-character-class': 'error',
'no-new-native-nonconstructor': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
// "no-promise-executor-return": "error",
'no-prototype-builtins': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-setter-return': 'error',
'no-sparse-arrays': 'warn',
'no-template-curly-in-string': 'warn',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable': 'warn',
'no-unreachable-loop': 'warn',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'no-unused-private-class-members': 'warn',
// 'no-use-before-define': [
// 'error'
// ],
'no-useless-backreference': 'error',
'require-atomic-updates': 'warn',
'use-isnan': 'error',
'valid-typeof': 'error',

parserOptions: {
// project: ["./tsconfig.eslint.json"],
// tsconfigRootDir: __dirname,
// "accessor-pairs": "error",
'arrow-body-style': 'off',
camelcase: 'warn',
'no-var': 'error',
'no-with': 'error',
'no-console': 'off',

// typescript
'@typescript-eslint/no-explicit-any': 'error',

'no-else-return': 'warn',

// svelte
'svelte/infinite-reactive-loop': 'error',
'svelte/no-dom-manipulating': 'warn',
'svelte/no-dupe-else-if-blocks': 'error',
'svelte/no-dupe-on-directives': 'error',
'svelte/no-dupe-style-properties': 'error',
'svelte/no-dupe-use-directives': 'error',
'svelte/no-export-load-in-svelte-module-in-kit-pages': 'warn',
'svelte/no-not-function-handler': 'error',
'svelte/no-object-in-text-mustaches': 'error',
'svelte/no-reactive-reassign': 'error',
'svelte/no-shorthand-style-property-overrides': 'error',
'svelte/no-store-async': 'error',
'svelte/no-unknown-style-directive-property': 'error',
'svelte/require-store-callbacks-use-set-param': 'warn',
'svelte/require-store-reactive-access': 'error',
'svelte/valid-compile': 'warn',
'svelte/no-at-html-tags': 'error',
'svelte/no-target-blank': 'warn',
'svelte/block-lang': ['error', { script: 'ts' }],
'svelte/button-has-type': 'warn',
'svelte/no-at-debug-tags': 'error',
'svelte/no-ignored-unsubscribe': 'error',
'svelte/no-immutable-reactive-statements': 'error',
'svelte/no-reactive-functions': 'error',
'svelte/no-reactive-literals': 'error',
'svelte/no-svelte-internal': 'error',
'svelte/no-unused-svelte-ignore': 'warn',
'svelte/no-useless-mustaches': 'warn',
'svelte/prefer-destructured-store-props': 'error',
'svelte/require-each-key': 'warn', // should probably be error
'svelte/require-event-dispatcher-types': 'warn', // I'll eventually want this to be an error
'svelte/require-optimized-style-attribute': 'error',
'svelte/require-stores-init': 'error',
'svelte/valid-each-key': 'error',
'svelte/derived-has-same-inputs-outputs': 'error',
'svelte/first-attribute-linebreak': 'warn',
'svelte/html-closing-bracket-spacing': 'warn',
// 'svelte/html-quotes': 'warn' // commented out because the formatter automatically puts double quotes currently
'svelte/html-self-closing': 'warn',
'svelte/indent': 'warn',
'svelte/max-attributes-per-line': [
'warn',
{
multiline: 1,
singleline: 1
}
],
'svelte/mustache-spacing': 'warn',
'svelte/no-extra-reactive-curlies': 'warn',
// 'svelte/no-restricted-html-elements': 'off'
'svelte/no-spaces-around-equal-signs-in-attribute': 'warn',
'svelte/prefer-class-directive': 'warn',
'svelte/prefer-style-directive': 'warn',
'svelte/shorthand-attribute': 'warn',
'svelte/sort-attributes': 'warn',
'svelte/spaced-html-comment': 'warn'
},

ignorePatterns: ['node_modules/', 'dist/', '**/*.js', '**/submodules/']
ignorePatterns: ['node_modules/', 'dist/', '**/*.js', '**/submodules/'],
env: {
'shared-node-browser': true,
browser: true,
es6: true,
jquery: true,
node: true
}
};
16 changes: 11 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: ./.github/workflows/e2e.yml
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
linter:
uses: ./.github/workflows/linter.yml
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
# linter:
# uses: ./.github/workflows/linter.yml
# secrets:
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
formatter:
uses: ./.github/workflows/formatter.yml
secrets:
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
# if branch is main
if: github.ref == 'refs/heads/main'
needs: [build, e2e, backend, linter, formatter, tsc]
needs: [build, e2e, backend, formatter, tsc]
steps:
- name: Retrieve git dependencies
uses: actions/checkout@v3
Expand Down Expand Up @@ -74,6 +74,12 @@ jobs:
echo "Merging main into deploy"
git merge main --strategy-option=theirs --allow-unrelated-histories -m "Merging main into gh-pages"
git pull origin main --allow-unrelated-histories
echo "formatting and linting"
npm i
npm run fmt
npm run lint
git add .
git commit --allow-empty -m "Merging main into deploy"
git push origin deploy
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Formatter
name: Format & Lint

on:
workflow_call:
Expand All @@ -16,7 +16,7 @@ permissions:
contents: read

jobs:
formatter:
format_and_lint:
runs-on: ubuntu-latest
steps:
- name: Retrieve git dependencies
Expand All @@ -36,3 +36,4 @@ jobs:
npm i
echo "Running formatter..."
npm run fmt
npm run lint
File renamed without changes.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@ yarn-error.log*
lerna-debug.log*

*/deps/*

*/templates/entries/

*/dir-tree.txt

branch-transfer/
deno.lock

credentials.json
token.json
*.assignment.json

cached-ids.json
blocked-ips.json

database.json
.gitbranch

# *.js
# !require.js
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// "functionLikeReturnTypes.enabled": true,
"parameterNames.enabled": "all",
"parameterTypes.enabled": true,
"propertyDeclarationTypes.enabled": true
"propertyDeclarationTypes.enabled": true,
// "variableTypes.enabled": true,
"eslint.validate": ["javascript", "typescript", "svelte"]
}
4 changes: 2 additions & 2 deletions client/entries/test/3d-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const edges = [
[3, 7]
];

const spline = new Spline(
const spline = new Spline([
new Point(...translate(scale([0, 0, 0], scaleMatrix), translateMatrix)),
new Point(...translate(scale([1, 0.5, 0], scaleMatrix), translateMatrix)),
new Point(...translate(scale([1, 0.5, 0], scaleMatrix), translateMatrix)),
Expand All @@ -76,7 +76,7 @@ const spline = new Spline(
...translate(scale([0.75, 0.25, 0.75], scaleMatrix), translateMatrix)
),
new Point(...translate(scale([0, 1, 0], scaleMatrix), translateMatrix))
);
]);

const splinePoints = spline.generatePoints(100);

Expand Down
Loading

0 comments on commit 221716a

Please sign in to comment.