Skip to content

Commit

Permalink
Merge branch 'master' into issue-993-security-refs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Bocharova committed Apr 24, 2024
2 parents 9a29e13 + ed66855 commit 4e75229
Show file tree
Hide file tree
Showing 72 changed files with 1,442 additions and 1,726 deletions.
64 changes: 64 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"env": {
"browser": true,
"es6": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react/recommended",
"next/core-web-vitals",
"plugin:sonarjs/recommended",
"plugin:jest/recommended",
"prettier"
],
"plugins": [
"eslint-plugin-import",
"eslint-plugin-react",
"@typescript-eslint",
"@typescript-eslint/tslint",
"sonarjs",
"jest",
"prettier"
],
"settings": {
"next": {
"rootDir": "playground/"
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"./library/tsconfig.json",
"./library/e2e/tsconfig.json",
"./playground/tsconfig.json",
"./web-component/tsconfig.json"
]
},
"root": true,
"rules": {
"prettier/prettier": "error",
"jest/expect-expect": [
"error",
{
"assertFunctionNames": ["expect", "cy"]
}
]
},
"ignorePatterns": [
"library/browser",
"library/lib",
"library/e2e/plugins/index.js",
"library/loaders/remove-hashbag-loader.js",
"library/jest.config.js",
"library/postcss.config.js",
"library/webpack.config.js",
"library/tailwind.config.js",
"playground/out",
"playground/postcss.config.js",
"web-component/lib",
"web-component/webpack.config.js"
]
}
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ tasks:
# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
ports:
- port: 3000
onOpen: open-preview
onOpen: open-preview
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ lerna-debug.log*
/.github

playground/.next/
playground/out/
1 change: 1 addition & 0 deletions library/e2e/integration/standalone.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jest/valid-title */
describe('Standalone bundle', () => {
testSuite('With parser', 'e2e/sites/standalone.html');
testSuite('With parser for v3', 'e2e/sites/standalone-v3.html');
Expand Down
2 changes: 1 addition & 1 deletion library/e2e/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ const webpackOptions = {
},
};

module.exports = on => {
module.exports = (on) => {
on('file:preprocessor', wp({ webpackOptions }));
};
2 changes: 1 addition & 1 deletion library/loaders/remove-hashbag-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Make sure code does not contain properties such as `#property`
*/
module.exports = function(source) {
module.exports = function (source) {
return source.replace(/^#! .*\n/, '');
};
2 changes: 2 additions & 0 deletions library/src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* @jest-environment jsdom
*/

/* eslint-disable sonarjs/no-duplicate-string */

import React from 'react';
import { render, waitFor } from '@testing-library/react';
import AsyncApiComponent from '..';
Expand Down
6 changes: 4 additions & 2 deletions library/src/components/Bindings.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import React from 'react';
import { Schema } from './Schema';
import { SchemaHelpers } from '../helpers';
Expand All @@ -16,8 +17,9 @@ export const Bindings: React.FunctionComponent<Props> = ({
return null;
}

const renderedBindings = bindings.all().map(binding => {
const renderedBindings = bindings.all().map((binding) => {
const bindingValue = binding.value();
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const schema = SchemaHelpers.jsonToSchema(bindingValue);
const protocol = binding.protocol();
const schemaName = (
Expand All @@ -34,7 +36,7 @@ export const Bindings: React.FunctionComponent<Props> = ({
schemaName={schemaName}
schema={schema}
key={protocol}
onlyTitle={true}
onlyTitle
/>
)
);
Expand Down
2 changes: 1 addition & 1 deletion library/src/components/CollapseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const CollapseButton: React.FunctionComponent<Props> = ({
{...chevronProps}
className={`inline-block align-baseline cursor-pointer ml-0.5 -mb-1 w-5 h-5 transform transition-transform duration-150 ease-linear ${
expanded ? '-rotate-90' : ''
} ${chevronProps?.className || ''}`}
} ${chevronProps?.className ?? ''}`}
/>
</button>
);
7 changes: 6 additions & 1 deletion library/src/components/Extensions.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import React from 'react';

import { Schema } from './Schema';
Expand All @@ -6,6 +9,7 @@ import { SchemaHelpers } from '../helpers';

interface Props {
name?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
item: any;
}

Expand All @@ -19,10 +23,11 @@ export const Extensions: React.FunctionComponent<Props> = ({
}

const schema = SchemaHelpers.jsonToSchema(extensions);

return (
schema && (
<div className="mt-2">
<Schema schemaName={name} schema={schema} onlyTitle={true} />
<Schema schemaName={name} schema={schema} onlyTitle />
</div>
)
);
Expand Down
Loading

0 comments on commit 4e75229

Please sign in to comment.