Skip to content

Tuning eslint #7391

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 0 additions & 185 deletions apps/rxjs.dev/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions apps/rxjs.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
"@types/lunr": "^2.3.3",
"@types/node": "^12.11.1",
"@types/svgo": "^1.3.3",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"archiver": "^3.0.0",
"canonical-path": "^1.0.0",
"chalk": "^2.1.0",
Expand All @@ -88,11 +86,6 @@
"css-selector-parser": "^1.3.0",
"dgeni": "^0.4.14",
"dgeni-packages": "^0.30.0",
"eslint": "^8.51.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jasmine": "^4.1.3",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"firebase-tools": "^9.3.0",
"fs-extra": "^8.0.1",
"globby": "^9.2.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/rxjs.dev/src/app/custom-elements/api/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ApiService implements OnDestroy {
* API sections is an array of Angular top modules and metadata about their API documents (items).
* Updates `sections` observable
*
* @param {string} [src] - Name of the api list JSON file
* @param [src] - Name of the api list JSON file
*/
fetchSections(src?: string) {
// TODO: get URL by configuration?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export class PrettyPrinter {

/**
* Format code snippet as HTML
* @param {string} code - the code snippet to format; should already be HTML encoded
* @param {string} [language] - The language of the code to render (could be javascript, html, typescript, etc)
* @param {string|number} [linenums] - Whether to display line numbers:
* @param code - the code snippet to format; should already be HTML encoded
* @param [language] - The language of the code to render (could be javascript, html, typescript, etc)
* @param [linenums] - Whether to display line numbers:
* - false: don't display
* - true: do display
* - number: do display but start at the given number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('ContributorListComponent', () => {
return comp;
}

interface SearchResult { [index: string]: string; };
interface SearchResult { [index: string]: string; }

class TestLocationService {
searchResult: SearchResult = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class ResourceService {

(categories as ConnectableObservable<Category[]>).connect();
return categories;
};
}
}

// Extract sorted Category[] from resource JSON data
Expand Down
2 changes: 1 addition & 1 deletion apps/rxjs.dev/src/app/search/search.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface EncodedPage {
addEventListener('message', handleMessage);

const customLunr = function (config: lunr.ConfigFunction) {
var builder = new lunr.Builder();
const builder = new lunr.Builder();
builder.pipeline.add(lunr.trimmer, lunr.stemmer);
builder.searchPipeline.add(lunr.stemmer);
config.call(builder, builder);
Expand Down
2 changes: 1 addition & 1 deletion apps/rxjs.dev/src/app/shared/deployment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export class Deployment {
mode: string = this.location.search()['mode'] || environment.mode;

constructor(private location: LocationService) {}
};
}
2 changes: 1 addition & 1 deletion apps/rxjs.dev/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SystemJS module definition */
declare var module: NodeModule;
declare let module: NodeModule;
interface NodeModule {
id: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ import { generateUniqueId } from './generateUniqueId';
* Depth is added to better determine later if it's an inital question
*
* @export
* @param {Tree} tree
* @param {number} [depth=0]
* @param tree
* @param [depth=0]
* @requires generateUniqueId
* @returns {Tree}
* @returns
*/
export function addUniqueId(tree: TreeNodeRaw[], depth = 0): TreeNode[] {
return tree.map(node => {
return tree.map((node) => {
let treeNode: TreeNode;
treeNode = {
label: node.label,
id: generateUniqueId(),
depth // used later in extractInitialSequence to determine the initial options
depth, // used later in extractInitialSequence to determine the initial options
};

if (node.children) {
const children = addUniqueId(node.children, depth + 1);
treeNode = {
...treeNode,
children,
options: children.map(({ id }) => id)
options: children.map(({ id }) => id),
};
}

if (node.method) {
treeNode = {
...treeNode,
method: node.method
method: node.method,
};
}

Expand Down
6 changes: 3 additions & 3 deletions apps/rxjs.dev/tools/decision-tree-generator/src/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { decisionTreeReducer } from './decisionTreeReducer';
* Main build script, outputs the decision tree.
*
* @export
* @param {FlattenedApiList} apiList
* @param {Tree} tree
* @param apiList
* @param tree
* @requires addUniqueId
* @requires extractInitialSequence
* @requires decisionTreeReducer
* @returns {DecisionTree}
* @returns
*/
export function build(apiList: FlattenedApiList, tree: TreeNodeRaw[]): DecisionTree {
const nodesWithUniqueIds = addUniqueId(tree);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
* Helps build the view model.
*
* @export
* @param {Tree} tree
* @param {FlattenedApiList} apiList
* @returns {DecisionTree}
* @param tree
* @param apiList
* @returns
*/
export function decisionTreeReducer(
tree: TreeNode[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { TreeNode } from './interfaces';
* Strip out initial sequence and add to tree
*
* @export
* @param {Tree} tree
* @returns {{id: string, options: string[]}}
* @param tree
* @returns
*/
export function extractInitialSequence(tree: TreeNode[]): {id: string, options: string[]} {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { isStable } from './helpers';
* Makes navigation easier.
*
* @export
* @param {ApiListNode[]} [apiList=[]]
* @param [apiList=[]]
* @requires isStable
* @returns {FlattenedApiList}
* @returns
* @todo create better type lenses - inference is not working well here
*/
export function flattenApiList(apiList: ApiListNode[]): FlattenedApiList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { randomBytes } from 'crypto';
*
* @export
* @requires crypto:randomByes
* @returns {string}
* @returns
*/
export function generateUniqueId(): string {
return randomBytes(2).toString('hex');
Expand Down
Loading