Skip to content

Commit

Permalink
chore: lint from root for frontend deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 23, 2023
1 parent bee61ff commit ff79d0d
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 115 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
!/.gitignore
!/.npmrc
!/.nvmrc
!/.prettierIgnore
!/.release-please-manifest.json
!/.reuse/
!/*.md
Expand Down
10 changes: 10 additions & 0 deletions .prettierIgnore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/template-oss/*.json
**/template-oss/*.yml
content/
content-debug/
cli/
.github/
package-lock.json
CODE_OF_CONDUCT.md
CONTENT-MODEL.md
SECURITY.md
15 changes: 3 additions & 12 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"test": "tap",
"posttest": "npm run lint"
"test": "jest",
"posttest": "npm run lint",
"format": "prettier --write ."
},
"dependencies": {
"@octokit/rest": "^20.0.2",
Expand All @@ -33,22 +34,12 @@
"tap": "^16.3.9"
},
"author": "GitHub Inc.",
"files": [
"bin/",
"lib/"
],
"engines": {
"node": ">=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.19.0",
"content": "./scripts/template-oss"
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
}
}
20 changes: 3 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"test": "tap",
"test": "jest",
"posttest": "npm run lint",
"test-all": "npm run test -ws -iwr --if-present",
"lint-all": "npm run lint -ws -iwr --if-present"
"lint-all": "npm run lint -ws -iwr --if-present",
"format": "prettier --write ."
},
"workspaces": [
"cli/",
Expand All @@ -45,10 +46,6 @@
"tap": "^16.3.9"
},
"author": "GitHub Inc.",
"files": [
"bin/",
"lib/"
],
"engines": {
"node": ">=18.0.0"
},
Expand All @@ -57,17 +54,6 @@
"version": "4.19.0",
"content": "./scripts/template-oss"
},
"tap": {
"test-ignore": "^(cli|theme)/",
"nyc-arg": [
"--exclude",
"cli/**",
"--exclude",
"theme/**",
"--exclude",
"tap-snapshots/**"
]
},
"eslintIgnore": [
".cache/",
"public/"
Expand Down
11 changes: 11 additions & 0 deletions scripts/template-oss/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
},
rootModule: {
add: {
'package.json': { file: 'pkg.json', overwrite: false },
'.eslintrc.js': false,
'CODE_OF_CONDUCT.md': false,
'CONTRIBUTING.md': false,
Expand All @@ -21,12 +22,21 @@ module.exports = {
'.github/settings.yml': false,
},
},
workspaceModule: {
add: {
'package.json': { file: 'pkg.json', overwrite: false },
'.eslintrc.js': false,
},
},
ciVersions: 'latest',
latestCiVersion: 18,
macCI: false,
windowsCI: false,
lockfile: true,
allowedPackages: ['eslint'],
requiredPackages: {
devDependencies: []
},
allowPaths: [
'/.reuse/',
'/src/',
Expand All @@ -38,5 +48,6 @@ module.exports = {
'/CONTRIBUTING.md',
'/CONTENT-MODEL.md',
'/.nvmrc',
'/.prettierIgnore',
],
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"test": "jest",
"format": "prettier --write ."
},
"files": {{{ del }}}
"files": {{{ del }}},
"tap": {{{ del }}}
}
43 changes: 0 additions & 43 deletions theme/.eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion theme/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
!/.eslintrc.js
!/.eslintrc.local.*
!/.gitignore
!/.prettierIgnore
!/bin/
!/CHANGELOG*
!/docs/
Expand Down
2 changes: 0 additions & 2 deletions theme/.prettierIgnore

This file was deleted.

21 changes: 1 addition & 20 deletions theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,7 @@
"styled-components": "^5.3.11"
},
"devDependencies": {
"@github/prettier-config": "^0.0.6",
"@npmcli/template-oss": "4.19.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^9.5.0",
"babel-jest": "^29.7.0",
"eslint": "^8.51.0",
"eslint-plugin-github": "^4.10.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-primer-react": "^4.0.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.0.3"
"@npmcli/template-oss": "4.19.0"
},
"author": "GitHub Inc.",
"engines": {
Expand All @@ -76,11 +63,5 @@
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.19.0",
"content": "./scripts/template-oss"
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
}
}
2 changes: 0 additions & 2 deletions theme/scripts/template-oss/_step-deps.yml

This file was deleted.

14 changes: 0 additions & 14 deletions theme/scripts/template-oss/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
module.exports = {
...require('../../../scripts/template-oss'),
workspaceRepo: {
add: {
'.github/settings.yml': false,
},
},
workspaceModule: {
add: {
'package.json': {file: 'pkg.json', overwrite: false},
'.eslintrc.js': false,
},
},
allowPaths: ['/src', '/gatsby-*.js', '/jest*.js', '/index.js', '/.prettierIgnore'],
requiredPackages: {
devDependencies: [],
},
}
17 changes: 16 additions & 1 deletion theme/src/components/hero.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import React from 'react'
import {Box, Heading, Text} from '@primer/react'
import {Box, Heading, Text, ThemeProvider} from '@primer/react'
import useSiteMetadata from '../hooks/use-site-metadata'
import Container from './container'

function Hero() {
const {title, description} = useSiteMetadata()

return (
<ThemeProvider colorMode="night" nightScheme="dark_dimmed">
<Box sx={{bg: 'canvas.default', py: 6}}>
<Container>
<Heading as="h1" sx={{color: 'accent.fg', fontSize: 7, m: 0}}>
{title}
</Heading>
<Text as="p" sx={{m: 0, color: 'fg.onEmphasis', fontSize: 4}}>
{description}
</Text>
</Container>
</Box>
</ThemeProvider>
)

return (
<Box bg="black" py={6}>
<Container>
Expand Down
6 changes: 4 additions & 2 deletions theme/src/root-element.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import {MDXProvider} from '@mdx-js/react'
import {Link, theme, SSRProvider, ThemeProvider} from '@primer/react'
import {Link, SSRProvider, ThemeProvider, theme} from '@primer/react'
import Blockquote from './mdx/blockquote'
import Code from './mdx/code'
import DescriptionList from './mdx/description-list'
Expand All @@ -21,6 +21,8 @@ function UnderlinedLink(props) {
return <Link {...props} underline={true} />
}

console.log(theme)

const components = {
a: UnderlinedLink,
pre: props => props.children,
Expand Down Expand Up @@ -52,7 +54,7 @@ function RootElement({element}) {
return (
<SSRProvider>
<MDXProvider components={components}>
<ThemeProvider theme={theme}>{element}</ThemeProvider>
<ThemeProvider>{element}</ThemeProvider>
</MDXProvider>
</SSRProvider>
)
Expand Down

0 comments on commit ff79d0d

Please sign in to comment.