Skip to content

Commit

Permalink
Switch to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed May 6, 2024
1 parent 062d092 commit 82bf4ee
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 37 deletions.
36 changes: 0 additions & 36 deletions .eslintrc.json

This file was deleted.

58 changes: 58 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import js from '@eslint/js'
import globals from 'globals'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
// global ignores
{
ignores: [
'.cache/**',
'.netlify/**',
'_site/**',
'node_modules/**',
'resources/**'
],
},
{
languageOptions: {
ecmaVersion: 2019,
sourceType: 'module',
globals: {
...globals.browser
}
},
linterOptions: {
reportUnusedDisableDirectives: 'error'
}
},
js.configs.recommended,
{
files: [
'**/*.js',
'**/*.mjs'
],
rules: {
'no-return-await': 'error',
'object-curly-spacing': [
'error',
'always'
],
'prefer-template': 'error',
semi: [
'error',
'never'
],
strict: 'error'
}
},
{
files: [
'scripts/**'
],
languageOptions: {
globals: {
...globals.nodeBuiltin
}
}
}
]
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"serve": "hugo server --port 4000 --disableFastRender --noHTTPCache --renderToMemory --printPathWarnings --printUnusedTemplates",
"serve-only": "npx sirv-cli _site --port 4000",
"test": "npm-run-all build --parallel --continue-on-error --aggregate-output test-*",
"test-eslint": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --ignore-path .gitignore --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .js,.mjs .",
"test-eslint": "eslint --cache --cache-location .cache/.eslintcache .",
"test-fusv": "fusv src/assets/scss/",
"test-stylelint": "stylelint src/assets/scss/ --cache --cache-location .cache/.stylelintcache",
"test-markdownlint": "markdownlint-cli2 \"**/*.md\" \"!**/node_modules/**\"",
Expand All @@ -34,12 +34,14 @@
"netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm run build"
},
"devDependencies": {
"@eslint/js": "^9.1.1",
"autoprefixer": "^10.4.19",
"bootstrap": "^5.3.3",
"clipboard": "^2.0.11",
"cross-env": "^7.0.3",
"eslint": "^9.2.0",
"find-unused-sass-variables": "^6.0.0",
"globals": "^14.0.0",
"hugo-bin": "^0.122.7",
"linkinator": "^6.0.4",
"lockfile-lint": "^4.13.2",
Expand Down

0 comments on commit 82bf4ee

Please sign in to comment.