Skip to content

Commit

Permalink
Merge pull request #317 from CodeForAfrica/fix/eslint_prettier
Browse files Browse the repository at this point in the history
Fix eslint prettier integration
  • Loading branch information
kilemensi authored Sep 7, 2023
2 parents f2aa870 + c5f473c commit 5713955
Show file tree
Hide file tree
Showing 7 changed files with 520 additions and 144 deletions.
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"extends": [
"plugin:markdown/recommended",
"plugin:json/recommended",
"plugin:import/warnings",
"plugin:import/errors",
"airbnb",
"plugin:react-hooks/recommended",
"airbnb/hooks",
"plugin:prettier/recommended",
"plugin:@next/next/recommended"
],
Expand Down
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@
"webpack": "^5.88.2"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.9",
"@babel/preset-env": "^7.22.14",
"@babel/core": "^7.22.15",
"@babel/eslint-parser": "^7.22.15",
"@babel/preset-env": "^7.22.15",
"@material-ui/codemod": "^4.5.1",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-transform-imports": "^2.0.0",
"eslint": "^8.46.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "^13.4.12",
"eslint-config-prettier": "^8.8.0",
"eslint-config-next": "^12.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-module-resolver": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-module-resolver": "^1.5.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^7.0.1",
"jscodeshift": "^0.13.0",
"lint-staged": "^12.3.3",
"prettier": "^3.0.2",
"prettier": "^3.0.3",
"svg-url-loader": "^7.1.1"
},
"browserslist": [
Expand All @@ -82,9 +82,5 @@
"*.yml": [
"yarn format-staged"
]
},
"volta": {
"node": "16.18.1",
"yarn": "1.22.19"
}
}
4 changes: 2 additions & 2 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const formatWeeklyP2Stats = (data) => {
}
const date = new Date(data[i].start_datetime).toLocaleDateString(
"en-US",
DATE_FMT_OPTIONS
DATE_FMT_OPTIONS,
);
stats.push({ date, averagePM });
}
Expand Down Expand Up @@ -185,7 +185,7 @@ const API = {
.toISOString()
.substring(0, 10);
return fetch(
`https://api.sensors.africa/v2/data/air/?city=${city}&from=${fromDate}&interval=day&value_type=P2`
`https://api.sensors.africa/v2/data/air/?city=${city}&from=${fromDate}&interval=day&value_type=P2`,
);
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function RadialGauge({ airPollDescription, airPollMeasurement, ...props }) {
transform = ((airPollMeasurement / 160) * 180).toFixed(2) - 90;
currentVal.setAttribute(
"transform",
`rotate(${transform}) translate(0,-310)`
`rotate(${transform}) translate(0,-310)`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Showcase/StoryList.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function StoryList(props) {
complete: (results) => {
processData(results?.data);
},
}
},
);
}, []);

Expand Down
10 changes: 5 additions & 5 deletions src/pages/air/city/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ function City({ city: citySlug, data, ...props }) {
const [city, setCity] = useState(citySlug);
const { air, weeklyP2 } = data;
const [cityHumidityStats, setCityHumidityStats] = useState(
getFormattedHumidityStats(air)
getFormattedHumidityStats(air),
);
const [cityP2Stats, setCityP2Stats] = useState(getFormattedP2Stats(air));
const [cityP2WeeklyStats, setCityP2WeeklyStats] = useState(
getFormattedWeeklyP2Stats(weeklyP2)
getFormattedWeeklyP2Stats(weeklyP2),
);
const [cityTemperatureStats, setCityTemperatureStats] = useState(
getFormattedTemperatureStats(air)
getFormattedTemperatureStats(air),
);

useEffect(() => {
Expand All @@ -176,8 +176,8 @@ function City({ city: citySlug, data, ...props }) {
API.getWeeklyP2Data(city)
.then((res) => res.json())
.then((json) =>
setCityP2WeeklyStats(getFormattedWeeklyP2Stats(json))
)
setCityP2WeeklyStats(getFormattedWeeklyP2Stats(json)),
),
)
.then(() => setIsLoading(false));
}
Expand Down
Loading

1 comment on commit 5713955

@vercel
Copy link

@vercel vercel bot commented on 5713955 Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.