-
Notifications
You must be signed in to change notification settings - Fork 88
fixing source filename to follow kebab-case convention and other eslint issues #1423 #1424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danielpeintner
merged 16 commits into
eclipse-thingweb:master
from
node-opcua:feat/check_file_naming_convention
Sep 26, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f0d4042
chore: upgrade to eslint 9 #1426
erossignon d3424c0
chore(cli): fix filename to follow convention #1423
erossignon 3508e76
chore(core): fix filename to follow convention #1423
erossignon ffec196
chore(eslint): enforce filenaming convention check #1423
erossignon 2af73e2
chore(eslint): activate @typescript-eslint/no-floating-promises rule …
erossignon 95b0fd0
chore(binding-opcua): fix floating promise issues
erossignon bdde976
chore(binding-http): remove console.log from tests (eslint)
erossignon 9ca66ae
chore(binding-mbus): remove console.log from tests (eslint)
erossignon 5d0df77
chore(binding-http): remove console.log from tests (eslint)
erossignon b70c51f
chore(binding-modbus): remove console.log from tests (eslint)
erossignon 5e617d4
chore(cli): fix eslint console.log issue
erossignon 78b893e
chore(examples): fix eslint console.log issue
erossignon 66b024d
chore(core): remove console.log from tests (eslint)
erossignon 09b505e
chore(eslint): enfore no-console rule
erossignon 43d3e5a
chore(eslint): switch to check-file instead of react-nameing-convention
erossignon 2c07bbf
chore(eslint): add licence.template.txt for copyright notice verifica…
erossignon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
import { defineConfig, globalIgnores } from "eslint/config"; | ||
|
||
import tsParser from "@typescript-eslint/parser"; | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import unusedImports from "eslint-plugin-unused-imports"; | ||
import workspaces from "eslint-plugin-workspaces"; | ||
import notice from "eslint-plugin-notice"; | ||
import globals from "globals"; | ||
import js from "@eslint/js"; | ||
import checkFile from "eslint-plugin-check-file"; | ||
|
||
import extraneousDependencies from "eslint-plugin-import"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
import nodePlugin from "eslint-plugin-n"; | ||
|
||
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 defineConfig([ | ||
...compat.extends( | ||
"eslint:recommended", | ||
"prettier", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:workspaces/recommended", | ||
"plugin:n/recommended" | ||
), | ||
// | ||
nodePlugin.configs["flat/recommended-script"], | ||
{ | ||
languageOptions: { | ||
parser: tsParser, | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: ["./tsconfig.eslint.json"], | ||
}, | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
"unused-imports": unusedImports, | ||
workspaces, | ||
notice, | ||
"extraneous-dependencies": extraneousDependencies, | ||
n: nodePlugin, | ||
"check-file": checkFile, | ||
}, | ||
|
||
rules: { | ||
// *************** Ensure that copyright notice is present *************** | ||
"notice/notice": [ | ||
"error", | ||
{ | ||
mustMatch: "Copyright \\(c\\) [0-9]{0,4} Contributors to the Eclipse Foundation", | ||
templateFile: __dirname + "/license.template.txt", | ||
onNonMatchingHeader: "replace", | ||
}, | ||
], | ||
|
||
// *************** NodeJS specific rules - relaxing default setting of n *************** | ||
"n/no-path-concat": "error", | ||
"n/no-unsupported-features/es-syntax": [ | ||
"error", | ||
{ | ||
ignores: ["modules"], | ||
}, | ||
], | ||
|
||
// relax missing import rule to warning, as we sometimes have optional dependencies | ||
// import "../foo" will braise a warning , | ||
// import "../foo.js" is the correct way to import a file that may not exist | ||
"n/no-missing-import": "warn", | ||
|
||
"n/no-unsupported-features/node-builtins": "warn", | ||
"n/no-extraneous-import": "warn", | ||
"n/no-deprecated-api": "warn", | ||
"n/no-unpublished-import": "warn", | ||
"n/no-process-exit": "warn", | ||
"n/hashbang": "warn", | ||
|
||
// *************** Ensure that only used dependencies are imported *************** | ||
"extraneous-dependencies/no-extraneous-dependencies": "warn", | ||
|
||
// *************** Code style and best practices *************** | ||
"unused-imports/no-unused-imports": "error", | ||
"unused-imports/no-unused-vars": [ | ||
"warn", | ||
{ | ||
args: "none", | ||
varsIgnorePattern: "Test", | ||
}, | ||
], | ||
|
||
// **************** enforece kebab-case for filenames **************** | ||
"check-file/filename-naming-convention": [ | ||
"error", | ||
{ | ||
"**/*.{js,ts}": "KEBAB_CASE", | ||
}, | ||
{ | ||
ignoreMiddleExtensions: true, | ||
}, | ||
], | ||
"check-file/folder-naming-convention": [ | ||
"error", | ||
{ | ||
"**/*": "KEBAB_CASE", | ||
}, | ||
], | ||
// *************** Customization of other typescript rules *************** | ||
"@typescript-eslint/no-use-before-define": "error", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-expressions": "off", | ||
"@typescript-eslint/no-require-imports": "warn", | ||
"@typescript-eslint/prefer-nullish-coalescing": "warn", | ||
"@typescript-eslint/no-empty-object-type": "warn", | ||
"@typescript-eslint/no-floating-promises": "warn", | ||
|
||
// **************** Enforce usage of `const` over `let` wherever possible, to prevent accidental reassignments | ||
"prefer-const": "warn", | ||
|
||
// *************** Other rules *************** | ||
"no-restricted-globals": "error", | ||
"no-restricted-properties": "error", | ||
|
||
"no-use-before-define": "error", | ||
|
||
"no-unused-private-class-members": "warn", | ||
"no-prototype-builtins": "off", | ||
"no-case-declarations": "off", | ||
|
||
"no-console": "error", | ||
// ***************** Enforce that for-in loops include an if statement to filter properties from the prototype chain | ||
"guard-for-in": "error", | ||
}, | ||
}, | ||
globalIgnores([ | ||
"utils/*", | ||
"packages/browser-bundle/types/index.d.ts", | ||
"packages/*/eslint.config.mjs", | ||
"eslint.config.mjs", | ||
"packages/browser-bundle/web-test-runner.config.mjs", | ||
"**/.eslintrc.js", | ||
"**/dist", | ||
"**/node_modules", | ||
"examples", | ||
"**/bin", | ||
"**/*.js", | ||
]), | ||
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and | ||
* Document License (2015-05-13) which is available at | ||
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513 | ||
********************************************************************************/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.