Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eslint #710

Merged
merged 4 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
.github
.changeset
/src/pages/lighthouse
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
env: {
node: true,
es2022: true,
browser: true,
},
extends: ['eslint:recommended', 'plugin:astro/recommended'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {},
overrides: [
{
files: ["*.astro"],
parser: "astro-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
rules: {},
},
delucis marked this conversation as resolved.
Show resolved Hide resolved
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
],
};
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint:linkcheck": "astro build && tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/lint-linkcheck.ts",
"lint:linkcheck:nobuild": "tsm --require=./scripts/lib/filter-warnings.cjs ./scripts/lint-linkcheck.ts",
"lint:slugcheck": "node ./scripts/lint-slugcheck.mjs",
"lint:eslint": "eslint . --ext .js,.ts,.astro",
"github:translation-status": "node ./scripts/github-translation-status.mjs"
},
"devDependencies": {
Expand All @@ -25,9 +26,14 @@
"@astrojs/sitemap": "^0.1.0",
"@babel/core": "^7.17.9",
"@types/react": "^17.0.43",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"astro": "^1.0.0-beta.17",
"astro-eslint-parser": "^0.2.2",
"bcp-47-normalize": "^2.1.0",
"dedent-js": "^1.0.1",
"eslint": "^8.16.0",
"eslint-plugin-astro": "^0.8.1",
"fast-glob": "^3.2.11",
"htmlparser2": "^7.2.0",
"kleur": "^4.1.4",
Expand All @@ -38,7 +44,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"simple-git": "^3.7.1",
"tsm": "^2.2.1"
"tsm": "^2.2.1",
"typescript": "^4.7.2"
},
"dependencies": {
"@astropub/icons": "^0.2.0",
Expand Down
Loading