mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-28 08:41:16 -07:00
Adding Linting and Formatting (#77)
Addresses #11 item "Linting/formatting (eg eslnt, prettier)": * Adding eslint, prettier, and config targeting Google, typescript, and both nodejs and client builds * Addressing linter-found issues * Adding lint and lint:fix commands * Adding documentation * Renaming workflow and adding lint check * Adding documentation about VSCode linting/formatting, ran formatting on a few files, set up exclude list for gatsby develop, setup build to fail on error
This commit is contained in:
parent
16a9e67db0
commit
a432a0d8c9
16 changed files with 310 additions and 208 deletions
|
@ -1,41 +1,57 @@
|
|||
module.exports = {
|
||||
/*
|
||||
This is to workaround the following error when building locally:
|
||||
Warning: React.createElement: type is invalid -- expected a string
|
||||
(for built-in components) or a class/function (for composite components) but got: undefined.
|
||||
at IndexPage
|
||||
We will need to fix this before running `gatsby build`
|
||||
*/
|
||||
flags: {
|
||||
DEV_SSR: false
|
||||
},
|
||||
siteMetadata: {
|
||||
title: "Justice40",
|
||||
title: 'Justice40',
|
||||
},
|
||||
pathPrefix: "/justice40-tool",
|
||||
pathPrefix: '/justice40-tool',
|
||||
plugins: [
|
||||
{
|
||||
resolve: 'gatsby-plugin-sass',
|
||||
options: {
|
||||
cssLoaderOptions: {
|
||||
modules: {
|
||||
exportLocalsConvention: 'camelCaseOnly'
|
||||
}
|
||||
}
|
||||
}
|
||||
exportLocalsConvention: 'camelCaseOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: `gatsby-plugin-intl`,
|
||||
options: {
|
||||
// language JSON resource path
|
||||
path: `${__dirname}/src/intl`,
|
||||
// supported language
|
||||
languages: [`en`, `es`],
|
||||
// language file path
|
||||
defaultLanguage: `en`,
|
||||
// option to redirect to `/en` when connecting `/`
|
||||
redirect: true,
|
||||
resolve: `gatsby-plugin-intl`,
|
||||
options: {
|
||||
// language JSON resource path
|
||||
path: `${__dirname}/src/intl`,
|
||||
// supported language
|
||||
languages: [`en`, `es`],
|
||||
// language file path
|
||||
defaultLanguage: `en`,
|
||||
// option to redirect to `/en` when connecting `/`
|
||||
redirect: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: 'gatsby-plugin-prettier-eslint',
|
||||
options: {
|
||||
prettier: {
|
||||
patterns: [
|
||||
// The pattern "**/*.{js,jsx,ts,tsx}" is
|
||||
// not used because we will rely on `eslint --fix`
|
||||
'**/*.{css,scss,less}',
|
||||
'**/*.{json,json5}',
|
||||
'**/*.{graphql}',
|
||||
'**/*.{md,mdx}',
|
||||
'**/*.{html}',
|
||||
'**/*.{yaml,yml}',
|
||||
],
|
||||
},
|
||||
eslint: {
|
||||
patterns: '**/*.{js,jsx,ts,tsx}',
|
||||
ignorePatterns: ['public', 'node_modules', '*scss.d.ts'],
|
||||
failOnError: true,
|
||||
customOptions: {
|
||||
fix: true,
|
||||
cache: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue