Skip to content
Merged
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
12 changes: 0 additions & 12 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ jobs:
- name: setup project
run: |
npm install --ignore-scripts --loglevel=silly
- name: setup examples
run: |
echo "::group::install example javascript"
npm run -- dev-setup:examples:js --ignore-scripts --loglevel=silly
echo "::endgroup::"
echo "::group::install example typescript cjs"
npm run -- dev-setup:examples:ts-cjs --ignore-scripts --loglevel=silly
echo "::endgroup::"
echo "::group::install examples typescript mjs"
npm run -- dev-setup:examples:ts-mjs --ignore-scripts --loglevel=silly
echo "::endgroup::"
- name: setup tools
run: |
echo "::group::install docs-gen deps"
Expand Down Expand Up @@ -332,7 +321,6 @@ jobs:
project-token: ${{ env.CODACY_PROJECT_TOKEN }}
coverage-reports: ${{ env.REPORTS_DIR }}/coverage/*/*


examples-JS:
needs: [ 'build' ]
name: example JS ${{ matrix.js-type }}
Expand Down
40 changes: 1 addition & 39 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,44 +69,6 @@ export default [
},
},
},
{
files: ['examples/**/*.{js,mjs,cjs,ts}'],
rules: {
'no-console': 'off'
},
},
{
files: ['examples/node/**/*.{js,mjs,cjs,ts}'],
rules: {
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off'
},
languageOptions: {
globals: globals.node
}
},
{
files: ['examples/web/*/src/**'],
languageOptions: {
globals: globals.browser
}
},
{
files: ['examples/node/typescript/example.cjs/src/*.ts'],
languageOptions: {
parserOptions: {
project: path.join(__dirname, 'examples', 'node', 'typescript', 'example.cjs', 'tsconfig.json')
},
},
},
{
files: ['examples/node/typescript/example.mjs/src/*.ts'],
languageOptions: {
parserOptions: {
project: path.join(__dirname, 'examples', 'node', 'typescript', 'example.mjs', 'tsconfig.json'
)
},
},
},
{
// global ignores must have nothing but a "ignores" property!
// see https://github.com/eslint/eslint/discussions/17429#discussioncomment-6579229
Expand All @@ -116,7 +78,7 @@ export default [
'docs/api/',
'docs/_build/',
'docs/.venv/',
'examples/**/dist/',
'examples/',
'res/schema/',
'tools/',
],
Expand Down
81 changes: 81 additions & 0 deletions examples/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*!
This file is part of CycloneDX JavaScript Library.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import path from 'node:path'
import { fileURLToPath } from 'node:url'

import baseCfg, { globals } from '../tools/code-style/eslint.config.mjs'

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

/* eslint-disable jsdoc/valid-types -- type-import not supported yet */

/**
* @type {import('../tools/code-style/node_modules/eslint').Linter.Config[]}
* @see https://eslint.org/
*/
export default [
...baseCfg, ,
{
files: ['./**/*.{js,mjs,cjs,ts}'],
rules: {
'no-console': 'off'
},
},
{
files: ['./node/**/*.{js,mjs,cjs,ts}'],
rules: {
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off'
},
languageOptions: {
globals: globals.node
}
},
{
files: ['./web/*/src/**'],
languageOptions: {
globals: globals.browser
}
},
{
files: ['./node/typescript/example.cjs/src/*.ts'],
languageOptions: {
parserOptions: {
project: path.join(__dirname, 'node', 'typescript', 'example.cjs', 'tsconfig.json')
},
},
},
{
files: ['./node/typescript/example.mjs/src/*.ts'],
languageOptions: {
parserOptions: {
project: path.join(__dirname, 'node', 'typescript', 'example.mjs', 'tsconfig.json'
)
},
},
},
{
// global ignores must have nothing but a "ignores" property!
// see https://github.com/eslint/eslint/discussions/17429#discussioncomment-6579229
ignores: [
'**/dist/',
],
},
]
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@
"test:node": "c8 mocha -p",
"test:web": "node -e 'console.log(\"TODO: write web test\")'",
"test:lint": "tsc --noEmit",
"pretest:standard": "npm run dev-setup:examples",
"test:standard": "npm --prefix tools/code-style exec -- eslint .",
"test:dependencies": "npm --prefix tools/test-dependencies exec -- knip --include dependencies,unlisted,unresolved --production",
"cs-fix": "npm --prefix tools/code-style exec -- eslint --fix .",
Expand Down
Loading