Skip to content

Commit

Permalink
Update ESLint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Dec 16, 2024
1 parent 59a484d commit da752bf
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 1,854 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
process.env.GITHUB_ACTIONS === 'true' ? 'mocha-reporter-gha=-' : null,
process.env.SONARSCANNER === 'true' ? 'mocha-reporter-sonarqube=test-report.xml' : null,
].filter(Boolean),
}
};
19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import MyrotvoretsConfig from '@myrotvorets/eslint-config-myrotvorets-ts';
import MochaPlugin from 'eslint-plugin-mocha';
import globals from 'globals';

/** @type {import('eslint').Linter.Config[]} */
export default [
{
ignores: ['dist/**'],
},
...MyrotvoretsConfig,
MochaPlugin.configs.flat.recommended,
{
languageOptions: {
globals: {
...globals.node,
},
},
},
];
1 change: 0 additions & 1 deletion lib/detectors/dockerdetector.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ATTR_CONTAINER_ID } from '@opentelemetry/semantic-conventions/incubatin
import { getContainerIDFormCGroup, getContainerIDFormCGroup2 } from './utils.mjs';

export class DockerDetector implements DetectorSync {
// eslint-disable-next-line class-methods-use-this
public detect(_config: ResourceDetectionConfig): IResource {
return new Resource({}, DockerDetector.getAsyncAttributes());
}
Expand Down
1 change: 0 additions & 1 deletion lib/detectors/k8sdetector.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import { getContainerIDFormCGroup } from './utils.mjs';

export class K8sDetector implements DetectorSync {
// eslint-disable-next-line class-methods-use-this
public detect(_config: ResourceDetectionConfig): IResource {
const matches = /^(.*)-([a-f0-9]+)-([a-z0-9]{5})$/u.exec(process.env['HOSTNAME'] ?? '');
if (!matches) {
Expand Down
1 change: 0 additions & 1 deletion lib/detectors/osdetector.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from '@opentelemetry/semantic-conventions/incubating';

export class OSDetector implements DetectorSync {
// eslint-disable-next-line class-methods-use-this
public detect(_config: ResourceDetectionConfig): IResource {
const attrs = {
[ATTR_HOST_NAME]: hostname(),
Expand Down
1 change: 0 additions & 1 deletion lib/detectors/packagejsondetector.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';

export class PackageJsonDetector implements DetectorSync {
// eslint-disable-next-line class-methods-use-this
public detect(_config: ResourceDetectionConfig): IResource {
return new Resource({}, PackageJsonDetector.getAsyncAttributes());
}
Expand Down
Loading

0 comments on commit da752bf

Please sign in to comment.