Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch master branch
run: |
git fetch origin master:master

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions Neo/neojs/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
sourceType: 'module'
},
rules: {
'func-style': [ 'error', 'declaration', { allowArrowFunctions: false } ],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neojs doesn't have code like const foo = () => {} so it doesn't hurt to keep it.

// These @typescript-eslint rules are disabled because they are replaced by the @stylistic rules.
'@typescript-eslint/indent': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
Expand Down
6 changes: 6 additions & 0 deletions resources/ext.neowiki/.eslintrc.diff.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
root: true,
rules: {
'func-style': [ 'error', 'declaration', { allowArrowFunctions: false } ]
}
};
3 changes: 2 additions & 1 deletion resources/ext.neowiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"tsc:watch": "vue-tsc -b --watch",
"vite:watch": "vite build --watch",
"build:watch": "npm-run-all --parallel tsc:watch vite:watch",
"lint:code": "eslint . --ext .vue,.ts --ignore-path .gitignore",
"lint:code": "eslint . --ext .vue,.ts --ignore-path .gitignore && npm run lint:diff",
"lint:diff": "(git diff --name-only master && git ls-files --others) | grep -E '\\.(vue|ts|js)$' | grep -v 'node_modules' | sed 's|^resources/ext.neowiki/||' | tee /dev/stderr | xargs -r sh -c 'for f; do [ -f \"$f\" ] && echo \"$f\"; done' sh | tee /dev/stderr | xargs -r eslint --config .eslintrc.diff.cjs",
"lint:styles": "NODE_NO_WARNINGS=1 stylelint \"src/**/*.{vue,scss}\"",
"lint": "npm-run-all lint:code lint:styles",
"test": "vitest run",
Expand Down
8 changes: 8 additions & 0 deletions resources/ext.neowiki/src/components/Value/CiTest.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div>TODO: Remove test file after testing</div>
</template>

<script setup lang="ts">
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const test = (): void => true; // For lint test, TODO: REMOVE
</script>
4 changes: 2 additions & 2 deletions resources/ext.neowiki/src/components/Value/NumberInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ const inputValue = computed( () => {

const valueFormat = NeoWikiServices.getValueFormatRegistry().getFormat( 'number' );

function onInput( newValue: string ): void {
const onInput = ( newValue: string ): void => { // For lint test, TODO: REMOVE
const value = newValue === '' ? undefined : newNumberValue( Number( newValue ) );
emit( 'update:modelValue', value );
validate( value );
}
};

function validate( value: NumberValue | undefined ): void {
const errors = valueFormat.validate( value, props.property );
Expand Down