Skip to content

Commit

Permalink
Eslint setup with TS type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bero committed Feb 20, 2024
1 parent 0795d44 commit eb9b062
Show file tree
Hide file tree
Showing 9 changed files with 1,724 additions and 102 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
// 'plugin:@typescript-eslint/recommended',
// Going with type checked because of https://typescript-eslint.io/rules/no-floating-promises
'plugin:@typescript-eslint/recommended-type-checked',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
globals: {
_: true, // TODO: replace with explicit imports
Meteor: true,
Npm: true,
Package: true,
Mongo: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: true,
},
plugins: ['@typescript-eslint'],
ignorePatterns: ['test*'],
rules: {
// For now
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
},
};
37 changes: 1 addition & 36 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 27 additions & 35 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,62 +1,54 @@
[email protected]
[email protected].1
[email protected].5
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
cultofcoders:[email protected]
dburles:[email protected]
cultofcoders:[email protected]
dburles:[email protected]
[email protected]
[email protected]
[email protected]
ddp-server@2.6.0
ddp-server@2.7.0
[email protected]
[email protected].2
[email protected].4
[email protected].0
[email protected].3
[email protected].8
[email protected].1
[email protected]
[email protected]
[email protected]
[email protected].2
[email protected].4
[email protected]
herteby:[email protected]
[email protected]
[email protected]
lai:[email protected]_1
local-test:cultofcoders:[email protected]
[email protected]
matb33:[email protected]
[email protected]
meteortesting:[email protected]
meteortesting:[email protected]
[email protected]
[email protected]
[email protected]
lai:[email protected]
[email protected]
matb33:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].3
[email protected].8
[email protected]
[email protected]
[email protected]
npm-mongo@4.12.1
npm-mongo@4.17.2
[email protected]
peerlibrary:[email protected]
peerlibrary:[email protected]
practicalmeteor:[email protected]
[email protected]
[email protected]
[email protected].3
[email protected].8
[email protected]
[email protected]
[email protected]
reywood:publish-composite@1.7.3
reywood:publish-composite@1.8.6
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
zodern:[email protected]
4 changes: 3 additions & 1 deletion lib/links/linkTypes/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ export default class Link {
/**
* @param {Grapher.IdSingleOption} what
* @param {boolean} [saveToDatabase]
* @returns {Promise<string | undefined>}
*
* Extracts a single id
*/
async identifyId(what, saveToDatabase) {
identifyId(what, saveToDatabase) {
return SmartArgs.getId(what, {
saveToDatabase,
collection: this.linkedCollection,
Expand Down Expand Up @@ -221,6 +222,7 @@ export default class Link {
* @param {string} action
* @param {Grapher.IdOption} [what]
* @param {unknown} [metadata]
* @returns {Promise<undefined | unknown[]>}
*
* @protected
*/
Expand Down
6 changes: 1 addition & 5 deletions lib/links/linkTypes/linkMany.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Link from './base.js';
import dot from 'dot-object';
import SmartArgs from './lib/smartArguments.js';
import { _ } from 'meteor/underscore';

export default class LinkMany extends Link {
Expand Down Expand Up @@ -41,10 +40,7 @@ export default class LinkMany extends Link {
},
};

const res = await this.linker.mainCollection.updateAsync(
this.object._id,
modifier,
);
await this.linker.mainCollection.updateAsync(this.object._id, modifier);

return this;
}
Expand Down
1 change: 0 additions & 1 deletion lib/links/linkTypes/linkOne.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from './base.js';
import SmartArgs from './lib/smartArguments.js';

export default class LinkOne extends Link {
/**
Expand Down
1 change: 0 additions & 1 deletion lib/links/linkTypes/linkOneMeta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { _ } from 'meteor/underscore';
import Link from './base.js';
import SmartArgs from './lib/smartArguments.js';

export default class LinkOneMeta extends Link {
/**
Expand Down
Loading

0 comments on commit eb9b062

Please sign in to comment.