Skip to content

Commit

Permalink
csslint; folders (+readme up) #2345 #2438 #2446 @PTheocharis @dodieboy
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored Jul 17, 2024
1 parent b60b117 commit 8c3f3a8
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 27 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,21 @@ 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 CSSLint
run: |
find css -type f -name '*.css' -exec npx csslint --config tests/csslint_rules.json {} +
# - 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


File renamed without changes.
31 changes: 31 additions & 0 deletions tests/csslint_rules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"rules": {
"adjoining-classes": "warn",
"box-model": "warn",
"box-sizing": "warn",
"compatible-vendor-prefixes": "warn",
"display-property-grouping": "warn",
"duplicate-background-images": "warn",
"floats": "warn",
"font-faces": "warn",
"font-sizes": "warn",
"gradients": "warn",
"ids": "warn",
"import": "warn",
"important": "warn",
"known-properties": "enforce",
"outline-none": "warn",
"overqualified-elements": "warn",
"qualified-headings": "warn",
"regex-selectors": "warn",
"shorthand": "warn",
"text-indent": "warn",
"underscore-property-hack": "warn",
"unique-headings": "warn",
"universal-selector": "warn",
"unqualified-attributes": "warn",
"vendor-prefix": "warn",
"zero-units": "warn"
}
}

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
}];
File renamed without changes.

0 comments on commit 8c3f3a8

Please sign in to comment.