Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 0 additions & 14 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
- run: npm ci
- run: sudo apt-get install libgtest-dev

- run: npm run lint
- run: npm run build
- run: npm run lint
- run: npm run test
34 changes: 0 additions & 34 deletions assembly/.eslintrc.cjs

This file was deleted.

48 changes: 48 additions & 0 deletions assembly/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier";
import path from "path";
import { fileURLToPath } from "url";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

export default
tseslint.config(
{
"ignores":["*.mjs"]
},
tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: [path.join(__dirname, "tsconfig.json")],
},
},
},

{
plugins: {
prettier: prettier,
},
},

{
rules: {
// Namespaces are quite useful in AssemblyScript
"@typescript-eslint/no-namespace": "off",

// There is actually codegen difference here
"@typescript-eslint/no-array-constructor": "off",

// Sometimes it can't be avoided to add a @ts-ignore
"@typescript-eslint/ban-ts-comment": "off",

// Not all types can be omitted in AS yet
"@typescript-eslint/no-inferrable-types": "off",

// The compiler has its own `Function` class for example
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
}
);
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { baseConfig } from "@schleifner/eslint-config-base/config.mjs";
export default [{
ignores: [
'dist/', // exclude specific folder
'**/*.mjs', // exclude all JavaScript files
],
},
...baseConfig];
19 changes: 19 additions & 0 deletions instrumentation/wasm-instrumentation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default initInstrumenter;

interface Instrumenter {
allocateUTF8(str: string): number;
_wasm_instrument(
fileName: number,
targetName: number,
reportFunction: number,
sourceMap: number,
expectInfoOutputFilePath: number,
debugInfoOutputFilePath: number,
includes: number,
excludes: number,
skipLib: boolean
): void;
_free(ptr: number): void;
}

declare function initInstrumenter(initInstrumenter?: {}): Promise<Instrumenter>;
7 changes: 4 additions & 3 deletions jest.config.ts → jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { JestConfigWithTsJest } from "ts-jest";

const config: JestConfigWithTsJest = {
const config = {
roots: ["tests/ts"],
extensionsToTreatAsEsm: [".ts"],
verbose: true,
Expand All @@ -12,11 +11,13 @@ const config: JestConfigWithTsJest = {
transform: {
"^.+\\.(ts|tsx)?$": ["ts-jest", { useESM: true }],
},
transformIgnorePatterns:['<rootDir>/third_party'],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
testPathIgnorePatterns: ["./dist"],
testPathIgnorePatterns: ["/dist/", "/third_party/", "/node_modules/"],
testTimeout: 10000,

};

export default config;
Loading
Loading