Skip to content
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

Moving fully to eslint, removing prettier #1024

Merged
merged 49 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2d03506
Combining lint rules into one .eslintrc.js file, removing prettier, m…
filmaj Jul 29, 2021
f661ff7
Update eslint-config-airbnb-typescript to v12 from v8 - eliminates pe…
filmaj Jul 30, 2021
d3f8e47
Use main tsconfig for mocha test run.
filmaj Jul 30, 2021
7dbf5a2
Add a src/types-specific rule for allowing type properties to be name…
filmaj Jul 29, 2021
a0e4517
Accept both camel and snake case for src/types/**/*.ts type properties.
filmaj Jul 30, 2021
31156fb
Fix import ordering in files - passes import/order lint rules.
filmaj Jul 30, 2021
df80a44
Fix indentation linter warnings
filmaj Aug 4, 2021
7fad415
Fix ban-types linter errors
filmaj Aug 4, 2021
2a136ec
Do not use generators to iterate over arrays, use array iterators ins…
filmaj Aug 4, 2021
d2e26ad
Remove extraneous interface, ignore unused type
filmaj Aug 4, 2021
cc9ffb5
Fixing lint errors for "no-use-before-define" rule.
filmaj Aug 5, 2021
1eebc5b
Fix missing function return types
filmaj Aug 6, 2021
81bdcd1
Export a function by default in modules
filmaj Aug 6, 2021
90cc33c
No multiple empty lines
filmaj Aug 6, 2021
abdafa5
Fixing space after block comment.
filmaj Aug 9, 2021
f1d06ca
Disable property-on-param reassignment warning for test helper code
filmaj Aug 9, 2021
bbabb64
Fixing no-undef-init rules
filmaj Aug 9, 2021
cc545b8
Fixing no-shadow lint rule failures.
filmaj Aug 9, 2021
84a8e7e
Fix object-shorthand lint rule failures.
filmaj Aug 9, 2021
e98755d
Fix failing no-empty-pattern rule; reuse the `noop` test handler wher…
filmaj Aug 9, 2021
5fb8a1f
Fix arrow-body-style lint failures.
filmaj Aug 9, 2021
695540e
Fix max length of line
filmaj Aug 9, 2021
c7909df
Remove type-specific snake_case naming rules and subsume into global …
filmaj Aug 9, 2021
fc8f4d5
Formatting, max-len and newline fixes
filmaj Aug 9, 2021
62341a8
Formating, fixing unary operators, spacing, addressing one-off lint f…
filmaj Aug 9, 2021
a3f95b1
Remove unneeded package.json run scripts.
filmaj Aug 9, 2021
40bc25d
Disable the only occurrences of no-nested-ternary - but is this the r…
filmaj Aug 9, 2021
47ea9c8
Attempt at rewriting nested ternary payload assignment into a switch.
filmaj Aug 10, 2021
df0a65f
Specify type of payload when processing events
filmaj Aug 11, 2021
ec00e2a
Turn off no-inferrable-types linting rule
filmaj Aug 6, 2021
04bb01f
Tweak the operator-linebreak lint rule: forbid line breaks around the…
filmaj Aug 5, 2021
a3df370
Expand allowed source directories where one may reach into their subd…
filmaj Aug 4, 2021
60e81e9
Remove strict-boolean-expressions rule. This rule effectively prevent…
filmaj Aug 9, 2021
03bfdff
Disable max-classes-per-file rule.
filmaj Aug 9, 2021
1523503
Enum members should use PascalCase.
filmaj Aug 9, 2021
29ecb16
Add test-specific ruleset and disable prefer-arrow-callback for tests.
filmaj Aug 6, 2021
7fd5213
Allow unused vars and args to exist if they have a leading underscore…
filmaj Aug 6, 2021
edd9490
Fix lint error for missing accessibility modifier on class methods
filmaj Aug 23, 2021
600546b
Fix lint errors for operator linebreaks.
filmaj Aug 23, 2021
b2cc2a5
Ignore import lint rules around use of require for importing package.…
filmaj Aug 25, 2021
97c708c
Fixing consistent-return linter warnings.
filmaj Aug 23, 2021
9cdc81d
Removing no-longer-needed eslint ignore directives, making explicit t…
filmaj Aug 25, 2021
814aec5
Removing no longer needed tslint directives.
filmaj Aug 25, 2021
bcb5d85
Remove unnecessary dependency
filmaj Aug 25, 2021
c0a57ac
Fix @typescript-eslint/ban-types linter failure
filmaj Aug 25, 2021
bafe97e
Fixing up bad merge
filmaj Aug 25, 2021
3914689
New lint fixes for new test file.
filmaj Aug 26, 2021
feb7f79
Move an eslint dependency to devDependencies.
filmaj Aug 26, 2021
a0104e6
Remove unnecessary type declaration / fix linter warning
filmaj Aug 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
342 changes: 288 additions & 54 deletions .eslintrc.js

Large diffs are not rendered by default.

26 changes: 0 additions & 26 deletions .eslintrc.test.js

This file was deleted.

19 changes: 10 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Happy linting! πŸ’–
{
"editor.rulers": [120],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": true
},
"[typescript]": {
"editor.formatOnSave": true
},
"prettier.configPath": ".prettierrc.json",
"editor.tabSize": 2,
// TODO: re-enable format on save once ESLint rules are more stable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a vscode user so I can't speak to these settings, could someone who uses vscode opine on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filmaj I think that disabling these is fine so far. One thing I'm slightly frustrated is that this works also for the example app projects under examples but the errors are not relevant. If we can disable this settings for examples at least, it would be helpful for maintainers.

// "editor.formatOnSave": false,
// "[javascript]": {
// "editor.formatOnSave": true
// },
// "[typescript]": {
// "editor.formatOnSave": true
// },
"editor.tabSize": 2,
"eslint.enable": true,
}
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
"prepare": "npm run build",
"build": "tsc",
"build:clean": "shx rm -rf ./dist ./coverage ./.nyc_output",
"lint": "prettier 'src/**/*.ts' --check && eslint --ext .ts src",
"test-lint": "prettier 'src/**/*.spec.ts' --check && prettier 'src/test-helpers.ts' --check && eslint --no-eslintrc -c .eslintrc.test.js \"src/**/*.spec.ts\" --fix && eslint --no-eslintrc -c .eslintrc.test.js \"src/test-helpers.ts\"",
"mocha": "TS_NODE_PROJECT=tsconfig.test.json nyc mocha --config .mocharc.json \"src/**/*.spec.ts\"",
"test": "npm run lint && npm run test-lint && npm run mocha && npm run test:types",
"lint": "eslint --ext .ts src",
"mocha": "TS_NODE_PROJECT=tsconfig.json nyc mocha --config .mocharc.json \"src/**/*.spec.ts\"",
"test": "npm run lint && npm run mocha && npm run test:types",
"test:types": "tsd",
"coverage": "codecov",
"watch": "npx nodemon --watch 'src' --ext 'ts' --exec npm run build"
Expand Down Expand Up @@ -62,25 +61,24 @@
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.6",
"@types/sinon": "^7.0.11",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.4.0",
"@typescript-eslint/eslint-plugin": "^4.4.1",
"@typescript-eslint/parser": "^4.4.0",
"chai": "^4.2.0",
"codecov": "^3.2.0",
"eslint": "^7.26.0",
"eslint-config-airbnb-typescript": "^8.0.2",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsdoc": "^28.5.1",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^30.6.1",
"eslint-plugin-node": "^11.1.0",
"mocha": "^6.1.4",
"nyc": "^14.0.0",
"prettier": "^2.0.5",
"rewiremock": "^3.13.4",
"shx": "^0.3.2",
"sinon": "^7.3.1",
"source-map-support": "^0.5.12",
"ts-node": "^8.1.0",
"tsd": "^0.13.1",
"tslint-config-airbnb": "^5.11.1",
"typescript": "^4.1.0"
},
"tsd": {
Expand Down