Skip to content

Commit ca26f63

Browse files
authored
chore: lint .js and .mjs files (in addition to the existing .ts file linting) (#2940)
1 parent c51fef1 commit ca26f63

File tree

157 files changed

+1645
-687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+1645
-687
lines changed

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ module.exports = {
8888
parserOptions: {
8989
sourceType: 'module',
9090
}
91+
},
92+
{
93+
files: ["test/**/*.js", "test/**/*.mjs"],
94+
rules: {
95+
"no-unused-vars": "off",
96+
}
9197
}
9298
]
9399
};

incubator/opentelemetry-sampler-aws-xray/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
3232
"compile": "tsc -p .",
3333
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/sampler-aws-xray",
34-
"lint": "eslint . --ext .ts",
35-
"lint:fix": "eslint . --ext .ts --fix",
34+
"lint": "eslint . --ext=ts,js,mjs",
35+
"lint:fix": "eslint . --ext=ts,js,mjs --fix",
3636
"prepublishOnly": "npm run compile",
3737
"tdd": "npm run test -- --watch-extensions ts --watch",
3838
"test": "nyc mocha 'test/**/*.test.ts'",

packages/auto-configuration-propagators/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"clean": "rimraf build/*",
2323
"compile": "tsc -p .",
2424
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-configuration-propagators",
25-
"lint": "eslint . --ext .ts",
26-
"lint:fix": "eslint . --ext .ts --fix",
25+
"lint": "eslint . --ext=ts,js,mjs",
26+
"lint:fix": "eslint . --ext=ts,js,mjs --fix",
2727
"prepublishOnly": "npm run compile",
2828
"tdd": "npm run test -- --watch-extensions ts --watch",
2929
"test": "nyc mocha 'test/**/*.ts'",

packages/auto-instrumentations-node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"clean": "rimraf build/*",
2727
"compile": "tsc -p .",
2828
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-node",
29-
"lint": "eslint . --ext .ts",
30-
"lint:fix": "eslint . --ext .ts --fix",
29+
"lint": "eslint . --ext=ts,js,mjs",
30+
"lint:fix": "eslint . --ext=ts,js,mjs --fix",
3131
"prepublishOnly": "npm run compile",
3232
"tdd": "yarn test -- --watch-extensions ts --watch",
3333
"test": "nyc mocha 'test/**/*.ts'",

packages/auto-instrumentations-node/test/test-app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const options = {
2121
hostname: 'example.com',
2222
port: 80,
2323
path: '/',
24-
method: 'GET'
24+
method: 'GET',
2525
};
2626

2727
const req = http.request(options);
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/*!
2-
* Copyright 2020, OpenTelemetry Authors
1+
/*
2+
* Copyright The OpenTelemetry Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,8 +17,10 @@
1717
const karmaWebpackConfig = require('../../karma.webpack');
1818
const karmaBaseConfig = require('../../karma.base');
1919

20-
module.exports = (config) => {
21-
config.set(Object.assign({}, karmaBaseConfig, {
22-
webpack: karmaWebpackConfig
23-
}))
20+
module.exports = config => {
21+
config.set(
22+
Object.assign({}, karmaBaseConfig, {
23+
webpack: karmaWebpackConfig,
24+
})
25+
);
2426
};

packages/auto-instrumentations-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
2525
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
2626
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/auto-instrumentations-web",
27-
"lint": "eslint . --ext .ts",
28-
"lint:fix": "eslint . --ext .ts --fix",
27+
"lint": "eslint . --ext=ts,js,mjs",
28+
"lint:fix": "eslint . --ext=ts,js,mjs --fix",
2929
"prepublishOnly": "npm run compile",
3030
"test:browser": "nyc karma start --single-run",
3131
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json"
Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
module.exports = {
2-
"env": {
3-
"mocha": true,
4-
"node": true
5-
},
6-
...require('../../eslint.config.js')
7-
}
17+
env: {
18+
mocha: true,
19+
node: true,
20+
},
21+
...require('../../eslint.config.js'),
22+
};

packages/baggage-log-record-processor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"clean": "rimraf build/*",
1414
"compile": "tsc -p .",
1515
"compile:with-dependencies": "nx run-many -t compile -p @opentelemetry/baggage-log-record-processor",
16-
"lint": "eslint . --ext .ts",
17-
"lint:fix": "eslint . --ext .ts --fix",
16+
"lint": "eslint . --ext=ts,js,mjs",
17+
"lint:fix": "eslint . --ext=ts,js,mjs --fix",
1818
"prewatch": "npm run precompile",
1919
"prepublishOnly": "npm run compile",
2020
"tdd": "npm run test -- --watch-extensions ts --watch",
Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
module.exports = {
2-
"env": {
3-
"mocha": true,
4-
"node": true
5-
},
6-
...require('../../eslint.config.js')
7-
}
17+
env: {
18+
mocha: true,
19+
node: true,
20+
},
21+
...require('../../eslint.config.js'),
22+
};

0 commit comments

Comments
 (0)