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

Linting Updates #13

Merged
merged 1 commit into from
Oct 17, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 30 additions & 58 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,77 +1,49 @@
{
"root": true,
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@next/next/recommended",
"plugin:react/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended"
"plugin:@typescript-eslint/recommended",
"prettier",
"next"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"jest",
"prettier",
"react-hooks",
"@next/next"
"@typescript-eslint",
"import"
],
"rules": {
"prettier/prettier": "error",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"no-console": "warn",
"no-debugger": "warn",
"no-unused-vars": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"@next/next/no-img-element": "error"
"@typescript-eslint/no-unused-vars": ["error"],
"react/prop-types": "off"
},
"settings": {
"react": {
"version": "detect"
},
"requireConfigFile": false
},
"overrides": [
{
"files": ["*.js", "*.jsx"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
},
"rules": {
// ...your JavaScript-specific rules here
}
},
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
// ...your TypeScript-specific rules here
}
}
]
}
}
}
2 changes: 1 addition & 1 deletion components/Button.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link'
import clsx from 'clsx'
import Link from 'next/link'

const styles = {
primary:
Expand Down
4 changes: 2 additions & 2 deletions components/DocsSidebarNavigation.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link'
import clsx from 'clsx'
import { gql } from '@apollo/client'
import clsx from 'clsx'
import Link from 'next/link'

DocsSidebarNavigation.fragment = gql`
fragment DocsSidebarNavigationFragment on RootQuery {
Expand Down
7 changes: 4 additions & 3 deletions components/FeatureTabsLeft.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useEffect, useState } from 'react'
import Image from 'next/image'
import { gql } from '@apollo/client'
import { Tab } from '@headlessui/react'
import clsx from 'clsx'
import Image from 'next/image'
import { useEffect, useState } from 'react'

import { Container } from '@/components/Container'
import { gql } from '@apollo/client'


const FeatureTabsLeft = (layout) => {
const { features } = layout
Expand Down
5 changes: 3 additions & 2 deletions components/FeatureTabsTop.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Image from 'next/image'
import { gql } from '@apollo/client'
import { Tab } from '@headlessui/react'
import clsx from 'clsx'
import Image from 'next/image'

import { Container } from '@/components/Container'
import { gql } from '@apollo/client'


function Feature({ feature, isActive, className, ...props }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion components/Fence.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment } from 'react'
import Highlight, { defaultProps } from 'prism-react-renderer'
import { Fragment } from 'react'

export function Fence({ children, language }) {
return (
Expand Down
3 changes: 2 additions & 1 deletion components/HomepageLayoutsLayoutsFaqs.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Container } from '@/components/Container'
import { gql } from '@apollo/client'

import { Container } from '@/components/Container'

const getColumns = (questions, numberOfColumns) => {
let columns = []
// start with the middle column to keep things centered
Expand Down
1 change: 1 addition & 0 deletions components/HomepageLayoutsLayoutsFeatures.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { gql } from '@apollo/client'

import FeatureTabsLeft from './FeatureTabsLeft'
import FeatureTabsTop from './FeatureTabsTop'

Expand Down
5 changes: 3 additions & 2 deletions components/HomepageLayoutsLayoutsHero.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Fragment } from 'react'
import { gql } from '@apollo/client'
import clsx from 'clsx'
import Highlight, { defaultProps } from 'prism-react-renderer'
import { Fragment } from 'react'

import { Button } from '@/components/Button'
import { gql } from '@apollo/client'


function TrafficLightsIcon(props) {
return (
Expand Down
7 changes: 4 additions & 3 deletions components/HomepageLayoutsLayoutsSupportedFieldTypes.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useEffect, useMemo, useRef, useState } from 'react'
import { gql } from '@apollo/client'
import clsx from 'clsx'
import { useInView } from 'framer-motion'
import Image from 'next/image'
import Link from 'next/link'
import { useEffect, useMemo, useRef, useState } from 'react'

import { Container } from '@/components/Container'
import Image from 'next/image'
import { gql } from '@apollo/client'


function FieldType({ title, uri, featuredImage, className, ...props }) {
let animationDelay = useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion components/Icon.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useId } from 'react'
import clsx from 'clsx'
import { useId } from 'react'

import { InstallationIcon } from '@/components/icons/InstallationIcon'
import { LightbulbIcon } from '@/components/icons/LightbulbIcon'
Expand Down
12 changes: 6 additions & 6 deletions components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useCallback, useEffect, useState } from 'react'
import Link from 'next/link'
import { gql } from '@apollo/client'
import { flatListToHierarchical } from '@faustwp/core'
import clsx from 'clsx'
import Link from 'next/link'
import { useCallback, useEffect, useState } from 'react'

import { PrimaryNavigation } from '@/components/PrimaryNavigation'
import { DocsSidebarNavigation } from '@/components/DocsSidebarNavigation'
import { PrimaryNavigation } from '@/components/PrimaryNavigation'
import { Prose } from '@/components/Prose'
import { gql } from '@apollo/client'
import { flatListToHierarchical } from '@faustwp/core'
import { collectHeadings } from '@/lib/utils'
import { SiteHeader } from '@/components/SiteHeader'
import { collectHeadings } from '@/lib/utils'

Layout.fragment = gql`
fragment LayoutFragment on RootQuery {
Expand Down
9 changes: 6 additions & 3 deletions components/LayoutArchive.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { DocsSidebarNavigation } from '@/components/DocsSidebarNavigation'
import { Prose } from '@/components/Prose'
import { gql } from '@apollo/client'
import { flatListToHierarchical } from '@faustwp/core'
import { SiteHeader } from '@/components/SiteHeader'

import { PrimaryNavigation } from './PrimaryNavigation'

import { DocsSidebarNavigation } from '@/components/DocsSidebarNavigation'
import { Prose } from '@/components/Prose'
import { SiteHeader } from '@/components/SiteHeader'


LayoutArchive.fragment = gql`
fragment LayoutArchiveFragment on RootQuery {
...PrimaryNavigationFragment
Expand Down
3 changes: 2 additions & 1 deletion components/LayoutFrontPage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { PrimaryNavigation } from '@/components/PrimaryNavigation'
import { gql } from '@apollo/client'
import { flatListToHierarchical } from '@faustwp/core'

import { PrimaryNavigation } from '@/components/PrimaryNavigation'
import { SiteHeader } from '@/components/SiteHeader'

LayoutFrontPage.fragment = gql`
Expand Down
6 changes: 3 additions & 3 deletions components/MobileNavigation.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect, useState } from 'react'
import { Dialog } from '@headlessui/react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { Dialog } from '@headlessui/react'
import { useEffect, useState } from 'react'

import { Logo } from '@/components/Logo'
import { DocsSidebarNavigation } from '@/components/DocsSidebarNavigation'
import { Logo } from '@/components/Logo'

function MenuIcon(props) {
return (
Expand Down
6 changes: 3 additions & 3 deletions components/PrimaryNavigation.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from 'react'
import Link from 'next/link'
import { gql } from '@apollo/client'
import Link from 'next/link'
import * as React from 'react'

import { cn } from '@/lib/utils'
import {
NavigationMenu,
NavigationMenuContent,
Expand All @@ -12,6 +11,7 @@ import {
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '@/components/ui/navigation-menu'
import { cn } from '@/lib/utils'

PrimaryNavigation.fragment = gql`
fragment PrimaryNavigationFragment on RootQuery {
Expand Down
8 changes: 4 additions & 4 deletions components/SiteHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { useEffect, useState } from 'react'
import Link from 'next/link'
import clsx from 'clsx'
import Link from 'next/link'
import { useEffect, useState } from 'react'

import { GitHubIcon } from '@/components/icons/GitHubIcon'
import { WordPressIcon } from '@/components/icons/WordPressIcon'
import { Logo } from '@/components/Logo'
import { MobileNavigation } from '@/components/MobileNavigation'
import { PrimaryNavigation } from '@/components/PrimaryNavigation'
import { Search } from '@/components/Search'
import { ThemeSelector } from '@/components/ThemeSelector'
import { GitHubIcon } from '@/components/icons/GitHubIcon'
import { WordPressIcon } from '@/components/icons/WordPressIcon'

export function SiteHeader({ navigation }) {
let [isScrolled, setIsScrolled] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion components/ThemeSelector.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'
import { Listbox } from '@headlessui/react'
import clsx from 'clsx'
import { useEffect, useState } from 'react'

const themes = [
{ name: 'Light', value: 'light', icon: LightIcon },
Expand Down
2 changes: 1 addition & 1 deletion components/ui/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { VariantProps, cva } from 'class-variance-authority'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
2 changes: 1 addition & 1 deletion components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { Slot } from '@radix-ui/react-slot'
import { VariantProps, cva } from 'class-variance-authority'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
2 changes: 1 addition & 1 deletion components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import * as React from 'react'
import * as LabelPrimitive from '@radix-ui/react-label'
import { VariantProps, cva } from 'class-variance-authority'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
2 changes: 1 addition & 1 deletion components/ui/navigation-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'
import { cva } from 'class-variance-authority'
import { ChevronDown } from 'lucide-react'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
2 changes: 1 addition & 1 deletion components/ui/separator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import * as React from 'react'
import * as SeparatorPrimitive from '@radix-ui/react-separator'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
2 changes: 1 addition & 1 deletion components/ui/tabs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import * as React from 'react'
import * as TabsPrimitive from '@radix-ui/react-tabs'
import * as React from 'react'

import { cn } from '@/lib/utils'

Expand Down
4 changes: 3 additions & 1 deletion faust.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { setConfig } from '@faustwp/core'
import templates from '@/wp-templates/index.js'

import possibleTypes from './possibleTypes.json'

import templates from '@/wp-templates/index.js'

/**
* @type {import('@faustwp/core').FaustConfig}
**/
Expand Down
Loading
Loading