Skip to content

Commit

Permalink
csslint attempt; files in folders #2345 #2438 #2446 @PTheocharis @dod…
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Jul 18, 2024
1 parent b60b117 commit 9b61bbd
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JS Lint and Test
name: eslint, csslint, jest, npm test, jslint

on:
push:
Expand Down Expand Up @@ -27,15 +27,24 @@ jobs:
run: npm install --force

- name: Run eslint
run: npx eslint
run: npx eslint --config=tests/eslint_rules.config.mjs
continue-on-error: true

# - name: Run JSLint
# run: npx jslint "**/*.js"
# continue-on-error: true

- name: Run Jest
run: npx jest
run: npx jest # --config=tests/jest.config.js

- name: Run npm test
run: npm test

- name: Install csslint using npm
run: npm install -g csslint@1.0.5

# - name: Lint CSS files
# run: |
# for file in $(grep -rl --include='*.css' '' ./); do npx csslint --config tests/csslint_rules.json "$file"; done


File renamed without changes.
13 changes: 10 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
"32": "menu/icons/32.png",
"48": "menu/icons/48.png"
},
"background": {
"background.scripts": "background.js"
},
"browser_specific_settings": {
"gecko": {
"id": "{3c6bf0cc-3ae2-42fb-9993-0d33104fdcaf}"
}
},
"background": {
"service_worker": "background.js",
"scripts": ["background.js"],
"background.scripts": "background.js"
},
"action": {
"default_popup": "menu/index.html",
"default_area": "navbar"
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/csslint_rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"rules":
{"known-properties":true,
}
}

50 changes: 26 additions & 24 deletions eslint.config.mjs → tests/eslint_rules.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
const rules = {
indent: ["error", "tab", {"SwitchCase": 1}],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-unused-vars": ["error", { "caughtErrors": "none" }],
"no-undef": "off",
"no-trailing-spaces": "warn",
"no-multi-spaces": "warn",
"semi-spacing": "warn",
"comma-spacing": "warn",
"no-fallthrough": ["error", { "allowEmptyCase": true }],
"no-implicit-globals": "error",
"no-multiple-empty-lines": ["error", {"max": 1, "maxBOF": 0, "maxEOF": 0}],
"keyword-spacing": ["warn", { "before": true, "after": true }],
"space-before-function-paren": "warn",
"space-before-blocks": "warn",
"max-len": ["error", {
code: 255,
ignoreUrls: true,
ignoreStrings: true,
ignoreComments: true,
ignoreRegExpLiterals: true
}]
};

import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
Expand Down Expand Up @@ -35,28 +60,5 @@ export default [...compat.extends("eslint:recommended"), ...compatConfiguration,
}
}
},
rules: {
indent: ["error", "tab", {"SwitchCase": 1}],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-unused-vars": ["error", { "caughtErrors": "none" }],
"no-undef": ["off"],
"no-trailing-spaces": "warn",
"no-multi-spaces": "warn",
"semi-spacing": "warn",
"comma-spacing": "warn",
"no-fallthrough": ["error", { "allowEmptyCase": true }],
"no-implicit-globals": "error",
"no-multiple-empty-lines": ["error", {"max": 1, "maxBOF": 0, "maxEOF": 0}],
"keyword-spacing": ["warn", { "before": true, "after": true }],
"space-before-function-paren": "warn",
"space-before-blocks": "warn",
"max-len": ["error", {
code: 255,
ignoreUrls: true,
ignoreStrings: true,
ignoreComments: true,
ignoreRegExpLiterals: true
}]
}
rules: rules
}];

0 comments on commit 9b61bbd

Please sign in to comment.