Skip to content

Commit

Permalink
Merge pull request #186 from curveball/upgrade-base-config-5
Browse files Browse the repository at this point in the history
Updated standard Curveball configuration.
  • Loading branch information
evert authored Dec 6, 2024
2 parents 9c3dc47 + 98bd62b commit 8050a55
Show file tree
Hide file tree
Showing 13 changed files with 1,425 additions and 3,163 deletions.
67 changes: 0 additions & 67 deletions .eslintrc.json

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/bun.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -37,9 +37,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
- run: npm ci
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
Expand All @@ -22,8 +22,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand All @@ -36,12 +36,12 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
Expand Down
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
SOURCE_FILES:=$(shell find src/ -type f -name '*.ts')
TEST_FILES:=$(shell find test/ -type f -name '*.ts')

.PHONY:all
all: build

.PHONY:build
build: dist/build assets
build: dist/build

.PHONY:test
test:
npx nyc mocha
npx tsx --test ${TEST_FILES}

.PHONY:lint
lint:
npx eslint --quiet 'src/**/*.ts*' 'test/**/*.ts*'
npx eslint --quiet

.PHONY:lint-fix
lint-fix: fix

.PHONY:fix
fix:
npx eslint --quiet 'src/**/*.ts*' 'test/**/*.ts*' --fix
npx eslint --quiet --fix

.PHONY:watch
watch:
Expand All @@ -32,20 +33,6 @@ start: build
clean:
rm -rf dist


dist/build: $(SOURCE_FILES)
npx tsc
touch dist/build

.PHONY:assets
assets: assets/js/html-form-enhancer.js assets/js/serialize-json-form.js

assets/js/html-form-enhancer.js: node_modules/html-form-enhancer/dist/html-form-enhancer.js
mkdir -p assets/js
cp node_modules/html-form-enhancer/dist/html-form-enhancer.* assets/js

assets/js/serialize-json-form.js: node_modules/html-form-enhancer/dist/serialize-json-form.js
cp node_modules/html-form-enhancer/dist/serialize-json-form.* assets/js

data/iana-links.json:
node util/fetch-link-relation-data.mjs > data/iana-links.json
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Changelog

* Add CSS style for experimental feature
* Fix an issue with loading JSON files when running as a dependency via npx.
* Updated standard Curveball configuration.
* Migrated from mocha to node:test.
* Migrated from chai to node:assert.


1.1.1 (2024-02-01)
Expand Down
65 changes: 65 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config({

files: ['src/**/*.ts', 'test/**/*.ts'],

extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
],
rules: {
indent: ["error", 2, {
SwitchCase: 1,
}],

"linebreak-style": ["error", "unix"],

"no-constant-condition": ["error", {
checkLoops: false,
}],

quotes: ["error", "single", {
allowTemplateLiterals: false,
avoidEscape: true,
}],

semi: ["error", "always"],

"no-console": ["error", {
allow: ["warn", "error", "info", "debug"],
}],

"no-trailing-spaces": "error",
"eol-last": "error",

"@typescript-eslint/ban-ts-comment": ["error", {
"ts-expect-error": "allow-with-description",
"ts-nocheck": "allow-with-description",
}],

"@typescript-eslint/ban-tslint-comment": "error",

"@typescript-eslint/consistent-type-assertions": ["error", {
assertionStyle: "as",
objectLiteralTypeAssertions: "never",
}],

"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",

"@typescript-eslint/no-unused-vars": ["error", {
ignoreRestSiblings: true,
args: "none",
}],

"@typescript-eslint/prefer-for-of": ["error"],
"@typescript-eslint/prefer-ts-expect-error": ["error"],
},
});
Loading

0 comments on commit 8050a55

Please sign in to comment.