fix(dev/ci): pre-commit fixes galore (#32352)

This commit is contained in:
Evan Rusackas
2025-02-24 11:26:45 -07:00
committed by GitHub
parent c583eec4c7
commit 90651dfe3e
91 changed files with 3435 additions and 2142 deletions

47
docs/.eslintrc.js Normal file
View File

@@ -0,0 +1,47 @@
/* eslint-env node */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['build/**/*', '.docusaurus/**/*', 'node_modules/**/*'],
};

View File

@@ -1,3 +1,4 @@
/* eslint-env node */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file

View File

@@ -17,9 +17,9 @@
* under the License.
*/
import type {Config} from '@docusaurus/types'
import type { Config } from '@docusaurus/types';
import type { Options, ThemeConfig } from '@docusaurus/preset-classic';
import { themes } from 'prism-react-renderer'
import { themes } from 'prism-react-renderer';
const { github: lightCodeTheme, vsDark: darkCodeTheme } = themes;
@@ -201,18 +201,18 @@ const config: Config = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
({versionDocsDirPath, docPath}) => {
editUrl: ({ versionDocsDirPath, docPath }) => {
if (docPath === 'intro.md') {
return 'https://github.com/apache/superset/edit/master/README.md'
return 'https://github.com/apache/superset/edit/master/README.md';
}
return `https://github.com/apache/superset/edit/master/docs/${versionDocsDirPath}/${docPath}`
}
return `https://github.com/apache/superset/edit/master/docs/${versionDocsDirPath}/${docPath}`;
},
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/blog/',
editUrl:
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/styles/custom.css'),
@@ -221,81 +221,80 @@ const config: Config = {
],
],
themeConfig:
{
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,
themeConfig: {
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,
},
algolia: {
appId: 'WR5FASX5ED',
apiKey: 'd0d22810f2e9b614ffac3a73b26891fe',
indexName: 'superset-apache',
},
navbar: {
logo: {
alt: 'Superset Logo',
src: '/img/superset-logo-horiz.svg',
srcDark: '/img/superset-logo-horiz-dark.svg',
},
algolia: {
appId: 'WR5FASX5ED',
apiKey: 'd0d22810f2e9b614ffac3a73b26891fe',
indexName: 'superset-apache',
},
navbar: {
logo: {
alt: 'Superset Logo',
src: '/img/superset-logo-horiz.svg',
srcDark: '/img/superset-logo-horiz-dark.svg',
items: [
{
label: 'Documentation',
to: '/docs/intro',
items: [
{
label: 'Getting Started',
to: '/docs/intro',
},
{
label: 'FAQ',
to: '/docs/faq',
},
],
},
items: [
{
label: 'Documentation',
to: '/docs/intro',
items: [
{
label: 'Getting Started',
to: '/docs/intro',
},
{
label: 'FAQ',
to: '/docs/faq',
},
],
},
{
label: 'Community',
to: '/community',
items: [
{
label: 'Resources',
href: '/community',
},
{
label: 'GitHub',
href: 'https://github.com/apache/superset',
},
{
label: 'Slack',
href: 'http://bit.ly/join-superset-slack',
},
{
label: 'Mailing List',
href: 'https://lists.apache.org/list.html?dev@superset.apache.org',
},
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/apache-superset',
},
],
},
{
href: '/docs/intro',
position: 'right',
className: 'default-button-theme get-started-button',
label: 'Get Started',
},
{
href: 'https://github.com/apache/superset',
position: 'right',
className: 'github-button',
},
],
},
footer: {
links: [],
copyright: `
{
label: 'Community',
to: '/community',
items: [
{
label: 'Resources',
href: '/community',
},
{
label: 'GitHub',
href: 'https://github.com/apache/superset',
},
{
label: 'Slack',
href: 'http://bit.ly/join-superset-slack',
},
{
label: 'Mailing List',
href: 'https://lists.apache.org/list.html?dev@superset.apache.org',
},
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/apache-superset',
},
],
},
{
href: '/docs/intro',
position: 'right',
className: 'default-button-theme get-started-button',
label: 'Get Started',
},
{
href: 'https://github.com/apache/superset',
position: 'right',
className: 'github-button',
},
],
},
footer: {
links: [],
copyright: `
<div class="footer__applitools">
We use &nbsp;<a href="https://applitools.com/" target="_blank" rel="nofollow"><img src="/img/applitools.png" title="Applitools" /></a>
</div>
@@ -318,17 +317,17 @@ const config: Config = {
<!-- telemetry/analytics pixel: -->
<img referrerPolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=39ae6855-95fc-4566-86e5-360d542b0a68" />
`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
docs: {
sidebar: {
hideable: true,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
docs: {
sidebar: {
hideable: true,
}
},
} satisfies ThemeConfig,
},
} satisfies ThemeConfig,
scripts: [
'/script/matomo.js',
// {

View File

@@ -14,7 +14,8 @@
"serve": "yarn run _init && docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
"typecheck": "tsc",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@ant-design/icons": "^5.5.2",
@@ -39,7 +40,14 @@
"@docusaurus/module-type-aliases": "^3.7.0",
"@docusaurus/tsconfig": "^3.6.3",
"@types/react": "^18.3.12",
"typescript": "^5.7.3",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.0.0",
"prettier": "^2.0.0",
"typescript": "~5.1.6",
"webpack": "^5.97.1"
},
"browserslist": {

View File

@@ -1,3 +1,4 @@
/* eslint-env node */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -39,42 +40,52 @@ const sidebars = {
{
type: 'category',
label: 'Installation',
items: [{
type: 'autogenerated',
dirName: 'installation',
}]
items: [
{
type: 'autogenerated',
dirName: 'installation',
},
],
},
{
type: 'category',
label: 'Configuration',
items: [{
type: 'autogenerated',
dirName: 'configuration',
}]
items: [
{
type: 'autogenerated',
dirName: 'configuration',
},
],
},
{
type: 'category',
label: 'Using Superset',
items: [{
type: 'autogenerated',
dirName: 'using-superset',
}]
items: [
{
type: 'autogenerated',
dirName: 'using-superset',
},
],
},
{
type: 'category',
label: 'Contributing',
items: [{
type: 'autogenerated',
dirName: 'contributing',
}]
items: [
{
type: 'autogenerated',
dirName: 'contributing',
},
],
},
{
type: 'category',
label: 'Security',
items: [{
type: 'autogenerated',
dirName: 'security',
}]
items: [
{
type: 'autogenerated',
dirName: 'security',
},
],
},
{
type: 'doc',
@@ -87,7 +98,6 @@ const sidebars = {
id: 'api',
},
],
};
module.exports = sidebars;

View File

@@ -94,7 +94,7 @@ const StyledSectionHeaderH2 = styled(StyledSectionHeader)`
`;
interface SectionHeaderProps {
level: any;
level: 'h1' | 'h2';
title: string;
subtitle?: string | ReactNode;
dark?: boolean;

View File

@@ -166,10 +166,9 @@ const StyledLink = styled('a')`
const FinePrint = styled('div')`
font-size: 14px;
color: var(--ifm-secondary-text);
`
`;
const Community = () => {
const [showCalendar, setShowCalendar] = useState(false); // State to control calendar visibility
const toggleCalendar = () => {
@@ -202,14 +201,17 @@ const Community = () => {
className="title"
href={url}
target="_blank"
rel="noreferrer"
aria-label={ariaLabel}
>
<img className="icon" src={`/img/community/${image}`} />
</a>
}
title={
<a href={url} target="_blank">
<p className="title" style={{marginBottom: 0}}>{title}</p>
<a href={url} target="_blank" rel="noreferrer">
<p className="title" style={{ marginBottom: 0 }}>
{title}
</p>
</a>
}
description={<p className="description">{description}</p>}
@@ -230,16 +232,22 @@ const Community = () => {
<StyledLink
href="https://calendar.google.com/calendar/u/0/r?cid=superset.committers@gmail.com"
target="_blank"
rel="noreferrer"
>
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
Subscribe to the Superset Community Calendar
</StyledLink>
<br />
<StyledLink onClick={toggleCalendar}>
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
<img src="/img/calendar-icon.svg" alt="calendar-icon" />
{showCalendar ? 'Hide Calendar' : 'Display Calendar*'}
</StyledLink>
{!showCalendar && <FinePrint><sup>*</sup>Clicking on this link will load and send data from and to Google.</FinePrint>}
{!showCalendar && (
<FinePrint>
<sup>*</sup>Clicking on this link will load and send data
from and to Google.
</FinePrint>
)}
</>
}
/>

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
// @ts-nocheck
import { useRef, useState, useEffect } from 'react';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
@@ -29,8 +28,6 @@ import SectionHeader from '../components/SectionHeader';
import BlurredSection from '../components/BlurredSection';
import '../styles/main.less';
// @ts-ignore
const features = [
{
image: 'powerful-yet-easy.jpg',
@@ -644,7 +641,10 @@ export default function Home(): JSX.Element {
</div>
</Carousel>
<video autoPlay muted controls loop>
<source src="https://superset.staged.apache.org/superset-video-4k.mp4" type="video/mp4" />
<source
src="https://superset.staged.apache.org/superset-video-4k.mp4"
type="video/mp4"
/>
</video>
</StyledSliderSection>
<StyledKeyFeatures>

View File

@@ -33,14 +33,14 @@ const EditPageLink = styled('a')`
background-position: 1rem center;
background-repeat: no-repeat;
transition: background-color 0.3s; /* Smooth transition for hover effect */
bpx-shadow: 0 0 0 0 rgba(0,0,0,0); /* Smooth transition for hover effect */
scale: .9;
bpx-shadow: 0 0 0 0 rgba(0, 0, 0, 0); /* Smooth transition for hover effect */
scale: 0.9;
transition: all 0.3s;
transform-origin: bottom right;
&:hover {
background-color: #333;
box-shadow: 5px 5px 10px 0 rgba(0,0,0,0.3);
box-shadow: 5px 5px 10px 0 rgba(0, 0, 0, 0.3);
scale: 1;
}
`;
@@ -48,7 +48,11 @@ const EditPageLink = styled('a')`
export default function DocItemWrapper(props) {
return (
<>
<EditPageLink href={props.content.metadata.editUrl} target="_blank" rel="noopener noreferrer">
<EditPageLink
href={props.content.metadata.editUrl}
target="_blank"
rel="noopener noreferrer"
>
Edit this page on GitHub
</EditPageLink>
<DocItem {...props} />

View File

@@ -19,4 +19,4 @@
const breakpoints = [576, 768, 992, 1200];
export const mq = breakpoints.map((bp) => `@media (max-width: ${bp}px)`);
export const mq = breakpoints.map(bp => `@media (max-width: ${bp}px)`);

View File

@@ -1,3 +1,4 @@
/* eslint-env browser */
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file

File diff suppressed because it is too large Load Diff