-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For code, add eslint, typescript-eslint, and stylistic. For styles, add stylelint and @stylistic/stylelint-plugin. Use new flat file format for eslint config. Clean up package.json Fix lint errors.
- Loading branch information
1 parent
3d1cd50
commit 219c8b2
Showing
11 changed files
with
2,557 additions
and
161 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"workspaces": [ | ||
"./packages/*" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import stylistic from "@stylistic/eslint-plugin"; | ||
import astroParser from "astro-eslint-parser"; | ||
import astro from "eslint-plugin-astro"; | ||
|
||
const stylisticRules = { | ||
"@stylistic/indent": ["error", "tab"], | ||
"@stylistic/eol-last": ["error", "always"], | ||
"@stylistic/no-trailing-spaces": ["error"], | ||
}; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
{ | ||
files: ["src/**/*.astro"], | ||
plugins: { | ||
astro, | ||
"@stylistic": stylistic, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
// enable the standard global variables available in Astro components | ||
node: true, | ||
"astro/astro": true, | ||
es2020: true, | ||
}, | ||
parser: astroParser, | ||
parserOptions: { | ||
parser: "@typescript-eslint/parser", | ||
extraFileExtensions: [".astro"], | ||
// the script frontmatter in Astro components uses ESM | ||
sourceType: "module", | ||
}, | ||
}, | ||
extends: [ | ||
...tseslint.configs.recommended, | ||
], | ||
rules: { | ||
"@stylistic/indent": ["error", "tab"], | ||
"@stylistic/eol-last": ["error", "always"], | ||
"@stylistic/no-trailing-spaces": ["error"], | ||
...astro.configs.all.rules, | ||
// this sometimes errors even when the class is used in the same file | ||
"astro/no-unused-css-selector": ["off"], | ||
// this errors when the class is just set to a single string via a variable | ||
"astro/prefer-class-list-directive": ["off"], | ||
}, | ||
}, | ||
{ | ||
files: ["src/**/*.{ts,tsx}"], | ||
extends: [ | ||
...tseslint.configs.recommended, | ||
], | ||
plugins: { | ||
"@stylistic": stylistic | ||
}, | ||
rules: { | ||
// Astro uses a triple slash reference in the env.d.ts file it automatically | ||
// creates, so just disable the rule to avoid trying to change that | ||
"@typescript-eslint/triple-slash-reference": ["off"], | ||
...stylisticRules, | ||
// this rule expects the tags in a .astro file to be indented at least | ||
// one level, but we want the outermost tag to start at column 0. so | ||
// only enable it in .tsx files, not .astro. | ||
"@stylistic/jsx-indent": ["error", "tab"], | ||
} | ||
}, | ||
{ | ||
files: ["src/**/*.{js,jsx}"], | ||
plugins: { | ||
"@stylistic": stylistic | ||
}, | ||
rules: { | ||
...stylisticRules, | ||
"@stylistic/jsx-indent": ["error", "tab"], | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,39 +3,39 @@ import { Icon } from "astro-icon/components"; | |
import NavLink from "./NavLink.astro"; | ||
const columns = [ | ||
[ | ||
"Resources", | ||
[ | ||
[ | ||
"https://docs.google.com/forms/d/e/1FAIpQLScHe7aWQ-2n3lSTU1WfcK8rhBZp8pkDGH9EcJdbQb5lqMbbzA/viewform", | ||
"propose a talk", | ||
], | ||
[ | ||
"https://docs.google.com/forms/d/e/1FAIpQLSexe5qvmJ6LTiU1HcR-XAzlrgPLBudVBPK_ouHeBkFz2JVUHw/viewform", | ||
"pitch a project", | ||
], | ||
], | ||
], | ||
[ | ||
"About", | ||
[ | ||
["about", "about"], | ||
["about", "meet the core team"], | ||
["about", "code of conduct"], | ||
["mailto:[email protected]", "contact"], | ||
], | ||
], | ||
[ | ||
"Elsewhere", | ||
[ | ||
["https://twitter.com/sfbrigade", "twitter", true], | ||
["https://www.facebook.com/codeforsanfrancisco", "facebook", true], | ||
["https://www.linkedin.com/company/18115347/", "linkedin", true], | ||
["https://github.com/sfbrigade/", "github", true], | ||
["https://c4sf.me/slack", "slack", true], | ||
["https://www.meetup.com/sfcivictech/", "meetup", true], | ||
], | ||
], | ||
[ | ||
"Resources", | ||
[ | ||
[ | ||
"https://docs.google.com/forms/d/e/1FAIpQLScHe7aWQ-2n3lSTU1WfcK8rhBZp8pkDGH9EcJdbQb5lqMbbzA/viewform", | ||
"propose a talk", | ||
], | ||
[ | ||
"https://docs.google.com/forms/d/e/1FAIpQLSexe5qvmJ6LTiU1HcR-XAzlrgPLBudVBPK_ouHeBkFz2JVUHw/viewform", | ||
"pitch a project", | ||
], | ||
], | ||
], | ||
[ | ||
"About", | ||
[ | ||
["about", "about"], | ||
["about", "meet the core team"], | ||
["about", "code of conduct"], | ||
["mailto:[email protected]", "contact"], | ||
], | ||
], | ||
[ | ||
"Elsewhere", | ||
[ | ||
["https://twitter.com/sfbrigade", "twitter", true], | ||
["https://www.facebook.com/codeforsanfrancisco", "facebook", true], | ||
["https://www.linkedin.com/company/18115347/", "linkedin", true], | ||
["https://github.com/sfbrigade/", "github", true], | ||
["https://c4sf.me/slack", "slack", true], | ||
["https://www.meetup.com/sfcivictech/", "meetup", true], | ||
], | ||
], | ||
] as const; | ||
--- | ||
|
||
|
@@ -48,10 +48,9 @@ const columns = [ | |
{links.map(([page, label, needsIcon]) => ( | ||
<li class="footer-list-cat-list-item "> | ||
{needsIcon && | ||
// adding a class attribute to the <Icon> component works just fine | ||
// but TS complains, so tell it to keep quiet | ||
// @ts-ignore | ||
<Icon name={"fa:" + label} class={"icon"} /> | ||
// @ts-expect-error adding a class attribute to the <Icon> component | ||
// works just fine but TS complains, so tell it to keep quiet | ||
<Icon name={"fa:" + label} class="icon" /> | ||
} | ||
<NavLink href={page}> | ||
{label} | ||
|
@@ -67,30 +66,30 @@ const columns = [ | |
<style> | ||
h3 { | ||
font-size: 1.25rem; | ||
margin: 0; | ||
text-transform: uppercase; | ||
} | ||
margin: 0; | ||
text-transform: uppercase; | ||
} | ||
|
||
ul { | ||
ul { | ||
--nav-element-spacing-horizontal: 0; | ||
align-items: start; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
align-items: start; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
ul:first-of-type, ul:last-of-type { | ||
margin-left: initial; | ||
margin-right: initial; | ||
} | ||
|
||
li { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
li { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.icon { | ||
display: inline-block; | ||
min-width: 1.5rem; | ||
text-align: center; | ||
} | ||
.icon { | ||
display: inline-block; | ||
min-width: 1.5rem; | ||
text-align: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,24 +15,24 @@ import BaseLayout from "@/layouts/BaseLayout.astro"; | |
<li> We respect the boundaries of others </li> | ||
</ul> | ||
|
||
<p> These are not just statements of belief, but principles that we collectively enact. | ||
We are dedicated to upholding them, and to ensuring that all members of our community | ||
respect them. </p> | ||
|
||
<p>The full Code of Conduct is available, with more detailed information about our | ||
community principles. You’ll also find our harassment policy, along with information | ||
about who to contact if you think the policy has been violated. For other questions | ||
about the Code of Conduct, or about our collective, reach out to [email protected]. | ||
<p> These are not just statements of belief, but principles that we collectively enact. | ||
We are dedicated to upholding them, and to ensuring that all members of our community | ||
respect them. </p> | ||
|
||
<p>The full Code of Conduct is available, with more detailed information about our | ||
community principles. You’ll also find our harassment policy, along with information | ||
about who to contact if you think the policy has been violated. For other questions | ||
about the Code of Conduct, or about our collective, reach out to [email protected]. | ||
</p> | ||
|
||
<div class="code-of-conduct-btn"> | ||
<a href="code-of-conduct" role="button">Read the full Code of Conduct</a> | ||
</div> | ||
<div class="code-of-conduct-btn"> | ||
<a href="code-of-conduct" role="button">Read the full Code of Conduct</a> | ||
</div> | ||
</BaseLayout> | ||
|
||
<style> | ||
h1, h2 { | ||
text-align: center | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
|
@@ -41,18 +41,17 @@ import BaseLayout from "@/layouts/BaseLayout.astro"; | |
|
||
p, ul { | ||
line-height: 1.4em; | ||
font-size: 16px; | ||
font-size: 16px; | ||
margin-bottom: 20px; | ||
|
||
li { | ||
margin-bottom: 0px | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.code-of-conduct-btn { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
</style> | ||
.code-of-conduct-btn { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.