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

docs: fix docs-lint and docs-test command #7364

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
185 changes: 185 additions & 0 deletions apps/rxjs.dev/.eslintrc.json
@@ -0,0 +1,185 @@
{
"root": true,
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "tests/e2e/tsconfig.json"],
"createDefaultProgram": true
},
"plugins": [
"@typescript-eslint",
// "@angular-eslint",
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to keep the comment here?

"eslint-plugin-jsdoc",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"eslint-plugin-prefer-arrow"
],
"rules": {
"@angular-eslint/component-class-suffix": "error",
"@angular-eslint/component-selector": [
"error",
{
"prefix": "aio",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/contextual-lifecycle": "error",
"@angular-eslint/directive-class-suffix": "error",
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "aio",
"style": "camelCase",
"type": "attribute"
}
],
"@angular-eslint/no-conflicting-lifecycle": "error",
"@angular-eslint/no-host-metadata-property": "off",
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-native": "error",
"@angular-eslint/no-output-on-prefix": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-lifecycle-interface": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"singleline": {
"delimiter": "comma",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/triple-slash-reference": [
"error",
{
"lib": "always",
"path": "always",
"types": "prefer-import"
}
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"arrow-parens": "off",
"comma-dangle": "off",
"complexity": "off",
"constructor-super": "error",
"curly": "error",
"eol-last": "error",
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"id-denylist": ["error", "any", "Number", "number", "String", "string", "Boolean", "boolean", "Undefined", "undefined"],
"id-match": "error",
"import/no-deprecated": "warn",
"indent": "off",
"jsdoc/check-alignment": "error",
"jsdoc/no-types": "error",
"max-classes-per-file": "off",
"max-len": ["error", 120],
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": [
"error",
{
"allow": ["log", "warn", "error"]
}
],
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-invalid-this": "off",
"no-multiple-empty-lines": "off",
"no-new-wrappers": "error",
"no-restricted-imports": [
"error",
{
"message": "Please import directly from \"rxjs\" instead",
"name": "rxjs/Rx"
}
],
"no-restricted-syntax": [
"error",
{
"message": "Don't keep jasmine focus methods.",
"selector": "CallExpression[callee.name=/^(fdescribe|fit)$/]"
}
],
"no-shadow": "off",
"no-tabs": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-var": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": "error",
"quote-props": ["error", "as-needed"],
"quotes": "off",
"radix": "error",
"sort-keys": "off",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"asyncArrow": "always",
"named": "never"
}
],
"use-isnan": "error",
"valid-typeof": "off"
}
}
]
}
11 changes: 7 additions & 4 deletions apps/rxjs.dev/package.json
Expand Up @@ -75,6 +75,8 @@
"@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 @@ -85,8 +87,11 @@
"css-selector-parser": "^1.3.0",
"dgeni": "^0.4.14",
"dgeni-packages": "^0.30.0",
"eslint": "^5.16.0",
"eslint-plugin-jasmine": "^2.2.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 Expand Up @@ -123,13 +128,11 @@
"svgson": "^4.1.0",
"tree-kill": "^1.2.2",
"ts-node": "^8.2.0",
"tslint": "~6.1.0",
"typescript": "4.5.4",
"unist-util-filter": "^1.0.2",
"unist-util-source": "^1.0.5",
"unist-util-visit": "^1.4.1",
"unist-util-visit-parents": "^2.1.2",
"vrsource-tslint-rules": "^6.0.0",
"watchr": "^4.1.0",
"xregexp": "^4.0.0",
"yamljs": "^0.3.0",
Expand Down
33 changes: 16 additions & 17 deletions apps/rxjs.dev/tools/transforms/.eslintrc.js
@@ -1,21 +1,20 @@
module.exports = {
'env': {
'es6': true,
'jasmine': true,
'node': true
root: true,
env: {
es6: true,
jasmine: true,
node: true,
},
'extends': [
'eslint:recommended',
'plugin:jasmine/recommended'
],
'plugins': [
'jasmine'
],
'rules': {
'indent': ['error', 2],
extends: ['eslint:recommended', 'plugin:jasmine/recommended'],
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['jasmine'],
rules: {
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'jasmine/new-line-before-expect': 0
}
'no-prototype-builtins': ['off'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'jasmine/new-line-before-expect': ['off'],
},
};
Expand Up @@ -35,6 +35,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
.processor(require('./processors/simplifyMemberAnchors'))
.processor(require('./processors/computeStability'))
.processor(require('./processors/markAliases').markAliases)
.processor(require('./processors/checkOperator'))

.factory(require('./post-processors/embedMarbleDiagrams'))

Expand Down
jakovljevic-mladen marked this conversation as resolved.
Show resolved Hide resolved
@@ -1,7 +1,7 @@
module.exports = function checkOperator() {
return {
$runAfter: ['generateApiListDoc'],
$runBefore: ['renderDocsProcessor'],
$runBefore: ['rendering-docs'],
$process(docs) {
docs.forEach((doc) => {
doc.isOperator = !!(doc.originalModule?.startsWith('internal/operators') && doc.docType === 'function');
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -33,7 +33,6 @@ module.exports = new Package('angular-base', [
.processor(require('./processors/fixInternalDocumentLinks'))
.processor(require('./processors/copyContentAssets'))
.processor(require('./processors/renderLinkInfo'))
.processor(require('./processors/checkOperator'))

// overrides base packageInfo and returns the one for the 'angular/angular' repo.
.factory('packageInfo', function () {
Expand Down
Expand Up @@ -68,7 +68,8 @@ describe('addImageDimensions post-processor', () => {
docType: 'a',
renderedContent: '<img src="missing">'
}];
expect(() => processor.$process(docs)).toThrowError('Unable to load src in image tag `<img src="missing">` - doc (a) ');
processor.$process(docs);
expect(log.warn).toHaveBeenCalledWith('Unable to load src in image tag `<img src="missing">` - doc (a) ');
expect(getImageDimensionsSpy).toHaveBeenCalledWith('base/path', 'missing');
});

Expand Down
Expand Up @@ -4,7 +4,7 @@ var Dgeni = require('dgeni');
describe('convertToJson processor', () => {
var dgeni, injector, processor, log;

beforeAll(function() {
beforeEach(function() {
dgeni = new Dgeni([testPackage('angular-base-package')]);
injector = dgeni.configureInjector();
processor = injector.get('convertToJsonProcessor');
Expand Down