Skip to content

Commit

Permalink
Fix eslint task
Browse files Browse the repository at this point in the history
Make sure the eslint task (manual or CI) does the same check as the
precommit hook.
  • Loading branch information
necolas committed Oct 9, 2024
1 parent 99811dc commit e598e12
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"build",
"coverage",
"dist",
"docs",
"flow-typed",
"logs",
"node_modules"
Expand Down
2 changes: 0 additions & 2 deletions apps/examples/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

// Learn more https://docs.expo.dev/guides/monorepos
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');

// Find the project and workspace directories
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '../..');

const config = getDefaultConfig(projectRoot);
// 1. Enable Metro support for symlinks and package exports
Expand Down
29 changes: 14 additions & 15 deletions apps/examples/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ function Shell(): React.MixedElement {
const [opacity, setOpacity] = React.useState(1);
const [transform, setTransform] = React.useState(TRANSLATE_NONE);
const [scale, setScale] = React.useState(SCALE_INACTIVE);
const [toggleTransform, setToggleTransform] = React.useState(false);
const [rotate, setRotate] = React.useState(ROTATE_INACTIVE);
const [skew, setSkew] = React.useState(SKEW_INACTIVE);
const [fadeUpActive, setFadeUpActive] = React.useState(true);
Expand Down Expand Up @@ -149,13 +148,13 @@ function Shell(): React.MixedElement {
<html.li>unordered list item: one</html.li>
</html.ul>
<html.img
height={150}
onLoad={(e) => {
console.log(e.type, e);
}}
width={150}
height={150}
src="http://placehold.jp/150x150.png"
style={styles.objContain}
width={150}
/>
<html.div />
<html.label for="id">label</html.label>
Expand All @@ -175,11 +174,11 @@ function Shell(): React.MixedElement {
<html.input placeholder="input type:text" type="text" />
<html.div />
<html.input
placeholder="input inputMode:numeric"
inputMode="numeric"
placeholder="input inputMode:numeric"
/>
<html.div />
<html.input placeholder="input enterKeyHint:go" enterKeyHint="go" />
<html.input enterKeyHint="go" placeholder="input enterKeyHint:go" />
<html.div />
<html.select>
<html.optgroup label="optgroup">
Expand Down Expand Up @@ -471,23 +470,23 @@ function Shell(): React.MixedElement {
onChange={(e) => {
console.log(e.type, e.target.value);
}}
onKeyDown={(e) => {
console.log(e.type, e.key);
}}
onInput={(e) => {
console.log(e.type, e.target.value);
}}
onKeyDown={(e) => {
console.log(e.type, e.key);
}}
/>
<html.textarea
onChange={(e) => {
console.log(e.type, e.target.value);
}}
onKeyDown={(e) => {
console.log(e.type, e.key);
}}
onInput={(e) => {
console.log(e.type, e.target.value);
}}
onKeyDown={(e) => {
console.log(e.type, e.key);
}}
/>
<html.div
onClick={(e) => {
Expand Down Expand Up @@ -546,23 +545,23 @@ function Shell(): React.MixedElement {
</html.div>

<html.img
height={150}
onLoad={(e) => {
setImageLoadText(`${e.type}: loaded`);
}}
width={150}
height={150}
src="http://placehold.jp/150x150.png"
style={styles.objContain}
width={150}
/>
<html.span>{imageLoadText}</html.span>
<html.img
height={150}
onError={(e) => {
setImageErrorText(`${e.type}: errored`);
}}
width={150}
height={150}
src="http://error"
style={styles.objContain}
width={150}
/>
<html.span>{imageErrorText}</html.span>
</ExampleBlock>
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function HomepageHeader() {
return (
<header className={clsx('hero hero--primary', styles.heroBanner)}>
<div className="container">
<img src="./img/logo.svg" height="100" />
<img height="100" src="./img/logo.svg" />
<Heading as="h1" className="hero__title">
{siteConfig.title}
</Heading>
Expand All @@ -32,8 +32,8 @@ export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
title={`Hello from ${siteConfig.title}`}
>
<HomepageHeader />
</Layout>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"jest": "npm run jest --workspaces --if-present --",
"jest:report": "npm run jest:report --workspaces --if-present --",
"lint": "npm run lint:report -- --fix",
"lint:report": "eslint packages",
"lint:report": "eslint \"**/*.js\"",
"test": "npm run flow && npm run lint:report && npm run jest:report",
"postinstall": "patch-package && npm run jest -- --clearCache && npm run build",
"prepare": "husky install tools/husky"
Expand Down Expand Up @@ -59,7 +59,7 @@
"**/*.js": [
"prettier --write",
"git update-index --again",
"eslint --config .eslintrc"
"eslint"
]
},
"prettier": {
Expand Down

0 comments on commit e598e12

Please sign in to comment.