-
Notifications
You must be signed in to change notification settings - Fork 542
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
Setting up ESLint #110
Merged
Merged
Setting up ESLint #110
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
783e2d2
fix: setting up eslint
rezakrimi 43e9f0f
resolving merge conflicts
rezakrimi 43d4c55
chore: setting up linter for propagators
rezakrimi 7a2f229
chore: adding browser linting settings for jeaeger propagator
rezakrimi 0da408b
chore: updating branch
rezakrimi 40f670b
chore: updating circleci checks
rezakrimi b86a8c3
chore: moving lint check to github actions
rezakrimi 7664f9b
chore: removing lint from workflows
rezakrimi cff73be
chore: updating packages
rezakrimi bb8a820
style: adding new line at the end of file
rezakrimi 621a962
style: fixing new line at the end of file
rezakrimi c981e4a
chore: updating github actions
rezakrimi 28205a0
style: running npm run lint:fix on all packages
rezakrimi 1f3b8fa
fix: fixing some of the linting issues & versions script
rezakrimi 50a5852
fix: fixing failing test for express plugin
rezakrimi d3ae113
style: fixing more linting issues
rezakrimi 7792633
style: adding Zone to eslint globals
rezakrimi f7c2ce7
fix: adding dns lookup supported by node 8
rezakrimi 3a4d6ae
style: fixing more linting issues
rezakrimi 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 contains 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 |
---|---|---|
|
@@ -126,25 +126,6 @@ browsers_unit_tests: &browsers_unit_tests | |
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then npm run codecov:browser; fi | ||
|
||
jobs: | ||
lint: | ||
docker: | ||
- image: node:12 | ||
environment: | ||
NPM_CONFIG_UNSAFE_PERM: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install minimal lint modules globally | ||
command: npm i -g tslint lerna typescript tslint-consistent-codestyle tslint-microsoft-contrib | ||
- run: | ||
name: Install gts version 1.1.0 globally | ||
command: npm i -g [email protected] | ||
- run: | ||
name: Symlink global modules into all lerna packages | ||
command: lerna exec 'npm link tslint lerna typescript gts tslint-consistent-codestyle tslint-microsoft-contrib' | ||
- run: | ||
name: Check code style and linting | ||
command: npm run lint | ||
node8: | ||
docker: | ||
- image: node:8 | ||
|
@@ -181,10 +162,6 @@ workflows: | |
version: 2 | ||
build: | ||
jobs: | ||
- lint: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
- node8 | ||
- node10 | ||
- node12 | ||
|
This file contains 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,28 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: restore lerna | ||
uses: actions/cache@master # must use unreleased master to cache multiple paths | ||
id: cache | ||
with: | ||
path: | | ||
node_modules | ||
packages/*/node_modules | ||
metapackages/*/node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} | ||
|
||
- name: Bootstrap | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
npm install --only=dev --ignore-scripts | ||
npx lerna bootstrap --no-ci --ignore-scripts -- --only=dev | ||
- name: Lint | ||
run: npm run lint |
This file contains 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,49 @@ | ||
module.exports = { | ||
plugins: [ | ||
"@typescript-eslint", | ||
"header" | ||
], | ||
extends: [ | ||
"./node_modules/gts", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
"project": "./tsconfig.json" | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-this-alias": "off", | ||
"eqeqeq": "off", | ||
"prefer-rest-params": "off", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "memberLike", | ||
"modifiers": ["private", "protected"], | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "require" | ||
} | ||
], | ||
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }], | ||
"arrow-parens": ["error", "as-needed"], | ||
"prettier/prettier": ["error", { "singleQuote": true, "arrowParens": "avoid" }], | ||
"node/no-deprecated-api": ["warn"], | ||
"header/header": [2, "block", [{ | ||
pattern: / \* Copyright The OpenTelemetry Authors[\r\n]+ \*[\r\n]+ \* Licensed under the Apache License, Version 2\.0 \(the \"License\"\);[\r\n]+ \* you may not use this file except in compliance with the License\.[\r\n]+ \* You may obtain a copy of the License at[\r\n]+ \*[\r\n]+ \* https:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0[\r\n]+ \*[\r\n]+ \* Unless required by applicable law or agreed to in writing, software[\r\n]+ \* distributed under the License is distributed on an \"AS IS\" BASIS,[\r\n]+ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.[\r\n]+ \* See the License for the specific language governing permissions and[\r\n]+ \* limitations under the License\./gm, | ||
template: | ||
`\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n ` | ||
}]] | ||
}, | ||
overrides: [ | ||
{ | ||
"files": ["test/**/*.ts"], | ||
"rules": { | ||
"no-empty": "off", | ||
"@typescript-eslint/ban-ts-ignore": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-var-requires": "off" | ||
} | ||
} | ||
] | ||
}; |
This file contains 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
This file contains 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 @@ | ||
build |
This file contains 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,7 @@ | ||
module.exports = { | ||
"env": { | ||
"mocha": true, | ||
"node": true | ||
}, | ||
...require('../../eslint.config.js') | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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 @@ | ||
build |
This file contains 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,7 @@ | ||
module.exports = { | ||
"env": { | ||
"mocha": true, | ||
"node": true | ||
}, | ||
...require('../../../eslint.config.js') | ||
} |
This file contains 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
This file contains 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
4 changes: 2 additions & 2 deletions
4
plugins/node/opentelemetry-plugin-dns/src/enums/AddressFamily.ts
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
4 changes: 2 additions & 2 deletions
4
plugins/node/opentelemetry-plugin-dns/test/functionals/dns-disable.test.ts
This file contains 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
4 changes: 2 additions & 2 deletions
4
plugins/node/opentelemetry-plugin-dns/test/functionals/dns-enable.test.ts
This file contains 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
4 changes: 2 additions & 2 deletions
4
plugins/node/opentelemetry-plugin-dns/test/functionals/utils.test.ts
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could extend the eslint config from the main repo so that changes are automatically picked up after a main repo release? wdyt @dyladan? (Not in scope for this PR though!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a way to depend on the file directly in github instead of a release. Very interesting idea though. A package like
@opentelemetry/eslint-config
would be a welcome addition I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could do something like
npm install --save-dev https://github.com/opentelemetry-js/opentelemetry-js/tarball/master
, or just the normal cloning urlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dyladan maybe we can create some general package that can be easily shared between contrib repo and here andd maybe even a 3rd party contrib. We could put there a bit more stuff, eslint, karma config, etc. basically all things that could be shared. WDYT ?