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

Run JavaScript linter in CI #47

Merged
merged 6 commits into from
Mar 11, 2024
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
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
"assets/js/scripts.js",
"assets/js/tinymce-shortcode.js",
"assets/js/asp-ajax.js",
"assets/js/decree-search.js"
"assets/js/decree-search.js",
"src/js/typewriter-effect.min.js"
],
"rules": {
"no-param-reassign": 0,
"no-shadow": "off",
"no-new": "off"
"no-new": "off",
"import/extensions": ["error", "always"]
}
}
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ jobs:
name: Install dependencies
run: npm ci
-
name: Run linter
name: Run SASS linter
run: npm run sass:lint
-
name: Run JavaScript linter
run: npm run js:lint
-
name: Check EditorConfig configuration
run: test -f .editorconfig
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"stylelint-order": "^6.0.3"
},
"engines": {
"node": "^18.12",
"npm": "^9.2",
"node": "^20.11",
"npm": "^10.2",
"yarn": "please-use-npm"
}
}
2 changes: 1 addition & 1 deletion src/js/cookie-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from './cookie.js';

(() => {
const lang = document.documentElement.lang;
const { lang } = document.documentElement;
const prefix = 'cone';
const btns = document.querySelectorAll('button[data-action="cookie"]');
let caption = '';
Expand Down
4 changes: 2 additions & 2 deletions src/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (getCookie('cone-cookie-law-analytics') === 'accepted') {

gtag('js', new Date());
gtag('config', coneGtagId, {
'cookie_domain': window.location.hostname,
'cookie_flags': 'SameSite=None;Secure'
cookie_domain: window.location.hostname,
cookie_flags: 'SameSite=None;Secure',
});
}
Loading