Skip to content

Commit

Permalink
Upgraded eslint and switched to other license header plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Aug 4, 2024
1 parent 8b5783a commit 74ec943
Show file tree
Hide file tree
Showing 346 changed files with 1,667 additions and 887 deletions.
6 changes: 4 additions & 2 deletions demo/demo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.
/*
Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
Licensed under the Apache License, Version 2.0.
*/

import { readFileSync } from 'node:fs';
import {
Expand Down
64 changes: 64 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import js from "@eslint/js";
import path from "node:path";
import pluginLicenseHeader from "eslint-plugin-license-header";
import pluginTypescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import { fileURLToPath } from "node:url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: [
"**/dist",
"deno/*.ts",
"demo/*.js",
"issue/*.ts",
"issue/*.js",
"tools/*.js",
"**/vite.config.ts",
],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
), {
plugins: {
"@eslint-plugin-license-header": pluginLicenseHeader,
"@typescript-eslint": pluginTypescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
project: [
"./tsconfig.json",
"./demo/tsconfig.json",
"./tests/tsconfig.json",
"./tools/tsconfig.json",
],
},
},

rules: {
"@eslint-plugin-license-header/header": [
"error",
[
"/*",
" Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.",
" Licensed under the Apache License, Version 2.0.",
"*/",
]
],
"@typescript-eslint/no-duplicate-enum-values": "off",
},
}];
6 changes: 4 additions & 2 deletions issue/issue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.
/*
Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
Licensed under the Apache License, Version 2.0.
*/

import { readFileSync, writeFileSync } from 'node:fs';
import { initializeImageMagick, ImageMagick } from '@imagemagick/magick-wasm';
Expand Down
Loading

0 comments on commit 74ec943

Please sign in to comment.