Skip to content

Commit

Permalink
- fs - rename files with dashes to files with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhu256 committed Oct 2, 2021
1 parent c7618e3 commit fbce8c0
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 59 deletions.
12 changes: 6 additions & 6 deletions .ci.sh
@@ -1,6 +1,6 @@
shArtifactUploadCustom() {(set -e
# this function will custom-upload build-artifacts to branch-gh-pages
# screenshot asset-image-logo
# screenshot asset_image_logo
shImageLogoCreate &
# screenshot install
shBrowserScreenshot \
Expand Down Expand Up @@ -63,18 +63,18 @@ echo "\
});
}());
' "$@" # '
# screenshot asset-image-logo-512.png
# screenshot asset_image_logo_512.png
shBrowserScreenshot .jslint_report.html \
--window-size=512x512 \
-screenshot=.build/screenshot-install-cli-report.png
-screenshot=.build/screenshot_install_cli_report.png
# seo - inline css-assets and invalidate cached-assets
node --input-type=module -e '
import moduleFs from "fs";
(async function () {
let cacheKey = Math.random().toString(36).slice(-4);
let fileDict = {};
await Promise.all([
"asset-codemirror-rollup.css",
"asset_codemirror_rollup.css",
"index.html",
"jslint.mjs"
].map(async function (file) {
Expand All @@ -88,11 +88,11 @@ import moduleFs from "fs";
// inline css-assets
fileDict["index.html"] = fileDict["index.html"].replace((
"\n<link rel=\"stylesheet\" href=\"asset-codemirror-rollup.css\">\n"
"\n<link rel=\"stylesheet\" href=\"asset_codemirror_rollup.css\">\n"
), function () {
return (
"\n<style>\n"
+ fileDict["asset-codemirror-rollup.css"].trim()
+ fileDict["asset_codemirror_rollup.css"].trim()
+ "\n</style>\n"
);
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -3,7 +3,6 @@
# Todo
- cli - add cli-command `--mode-coverage-report`
- coverage - add macros `/*coverage-disable*/` and `/*coverage-enable*/`.
- fs - rename files with dashes to files with underscore
- jslint - add `for...of` syntax support.
- jslint - add html and css linting back into jslint.
- jslint - add new warning requiring paren around comma-separated concatenations.
Expand All @@ -13,6 +12,7 @@
- node - after node-v14 is deprecated, remove shell-code `export "NODE_OPTIONS=--unhandled-rejections=strict"`.

# v2021.10.1-beta
- fs - rename files with dashes to files with underscore
- cli - add cli-option `--mode-report`
- fs - merge file browser.mjs into index.html
- jslint - disable linting of embedded javascript in markdown-files
Expand Down
40 changes: 20 additions & 20 deletions README.md
@@ -1,4 +1,4 @@
[<img align="left" height="100" src="asset-image-logo-512.svg"/>](https://github.com/jslint-org/jslint)
[<img align="left" height="100" src="asset_image_logo_512.svg"/>](https://github.com/jslint-org/jslint)


# JSLint, The JavaScript Code Quality Tool
Expand All @@ -13,8 +13,8 @@ Douglas Crockford <douglas@crockford.com>
|--:|:--:|:--:|:--:|
| CI | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jslint-org/jslint/actions?query=branch%3Amaster) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/jslint-org/jslint/actions?query=branch%3Abeta) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=alpha)](https://github.com/jslint-org/jslint/actions?query=branch%3Aalpha) |
| Coverage | [![coverage](https://jslint-org.github.io/jslint/branch-master/.build/coverage/coverage-badge.svg)](https://jslint-org.github.io/jslint/branch-master/.build/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-beta/.build/coverage/coverage-badge.svg)](https://jslint-org.github.io/jslint/branch-beta/.build/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-alpha/.build/coverage/coverage-badge.svg)](https://jslint-org.github.io/jslint/branch-alpha/.build/coverage/index.html) |
| Demo | [<img src="asset-image-logo-512.svg" height="32">](https://jslint-org.github.io/jslint/branch-master/index.html) | [<img src="asset-image-logo-512.svg" height="32">](https://jslint-org.github.io/jslint/branch-beta/index.html) | [<img src="asset-image-logo-512.svg" height="32">](https://jslint-org.github.io/jslint/branch-alpha/index.html) |
| Artifacts | [<img src="asset-image-folder-open-solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-master/.build) | [<img src="asset-image-folder-open-solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.build) | [<img src="asset-image-folder-open-solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-alpha/.build) |
| Demo | [<img src="asset_image_logo_512.svg" height="32">](https://jslint-org.github.io/jslint/branch-master/index.html) | [<img src="asset_image_logo_512.svg" height="32">](https://jslint-org.github.io/jslint/branch-beta/index.html) | [<img src="asset_image_logo_512.svg" height="32">](https://jslint-org.github.io/jslint/branch-alpha/index.html) |
| Artifacts | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-master/.build) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.build) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-alpha/.build) |


# Table of Contents
Expand All @@ -32,7 +32,7 @@ Douglas Crockford <douglas@crockford.com>
# Web Demo
- https://www.jslint.com

[![screenshot](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-browser-_2fjslint_2fbranch-beta_2findex.html.png)](https://jslint-org.github.io/jslint/index.html)
[![screenshot](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_browser__2fjslint_2fbranch-beta_2findex.html.png)](https://jslint-org.github.io/jslint/index.html)


# Web Demo Archived
Expand All @@ -43,17 +43,17 @@ Douglas Crockford <douglas@crockford.com>

# JSLint Install
### To install, just download https://www.jslint.com/jslint.mjs and save to file:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-download.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_download.svg -->
#!/bin/sh

curl -L https://www.jslint.com/jslint.mjs > jslint.mjs
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-download.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_download.svg)

### To run `jslint.mjs` from command-line:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-cli-file.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_cli_file.svg -->
#!/bin/sh

printf "console.log('hello world');\n" > hello.js
Expand All @@ -62,10 +62,10 @@ node jslint.mjs hello.js
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-cli-file.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_cli_file.svg)

### To import `jslint.mjs` as es-module:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-import.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_import.svg -->
#!/bin/sh

node --input-type=module -e '
Expand All @@ -87,22 +87,22 @@ result.warnings.forEach(function ({
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-import.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_import.svg)

### To jslint entire directory from command-line:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-cli-dir.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_cli_dir.svg -->
#!/bin/sh

node jslint.mjs .
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-cli-dir.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_cli_dir.svg)


# JSLint Report
### To create human-readable, html-report from command-line:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-cli-report.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_cli_report.svg -->
#!/bin/sh

printf "function foo() {console.log('hello world');}\n" > hello.js
Expand All @@ -111,15 +111,15 @@ node jslint.mjs --mode-report hello.js
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-cli-report.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_cli_report.svg)

- screenshot file `.jslint_report.html`

![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-cli-report.png)
![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_cli_report.png)


### To create human-readable, html-report programmatically:
```shell <!-- shRunWithScreenshotTxt .build/screenshot-install-import-report.svg -->
```shell <!-- shRunWithScreenshotTxt .build/screenshot_install_import_report.svg -->
#!/bin/sh

node --input-type=module -e '
Expand All @@ -141,7 +141,7 @@ import fs from "fs";
```
- shell output

![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-install-import-report.svg)
![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_install_import_report.svg)


# JSLint Vim Plugin
Expand All @@ -153,7 +153,7 @@ import fs from "fs";
- with vim-key-combo `<Ctrl-S> <Ctrl-J>`
- screenshot

![screenshot.png](asset-image-jslint-vim-plugin.png)
![screenshot.png](asset_image_jslint_vim_plugin.png)


# Description
Expand Down Expand Up @@ -183,13 +183,13 @@ right so that you can focus your creative energy where it is most needed.


# Package Listing
![screenshot-files.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-files.svg)
![screenshot_files.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_files.svg)


# Changelog
- [Full CHANGELOG.md](CHANGELOG.md)

![screenshot-changelog.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot-changelog.svg)
![screenshot_changelog.svg](https://jslint-org.github.io/jslint/branch-beta/.build/screenshot_changelog.svg)


# License
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 6 additions & 6 deletions function.html
Expand Up @@ -18,21 +18,21 @@
<link
rel="icon"
type="image/png"
href="asset-image-logo-512.svg"
href="asset_image_logo_512.svg"
/>
<title>JSLint: jslint function</title>
<style>
@font-face {
font-display: swap;
font-family: "Programma";
font-weight: bold;
src: url("asset-font-programma-bold.woff2") format("woff2");
src: url("asset_font_programma_bold.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Daley";
font-weight: bold;
src: url("asset-font-daley-bold.woff2") format("woff2");
src: url("asset_font_daley_bold.woff2") format("woff2");
}
body {
background-color: seashell;
Expand Down Expand Up @@ -603,9 +603,9 @@ <h1>Reports</h1>
</center>

<center>
<a href="https://www.JSLint.com/"><img src="asset-image-logo-512.svg" height="20"></a>
<a href="https://github.com/jslint-org/jslint"><img src="asset-image-github-brands.svg" height="20"></a>
<a href="https://www.JSON.org/"><img src="asset-image-json-160.gif" height="20"></a>
<a href="https://www.JSLint.com/"><img src="asset_image_logo_512.svg" height="20"></a>
<a href="https://github.com/jslint-org/jslint"><img src="asset_image_github_brands.svg" height="20"></a>
<a href="https://www.JSON.org/"><img src="asset_image_json_160.gif" height="20"></a>
</center>
</body>
</html>
14 changes: 7 additions & 7 deletions help.html
Expand Up @@ -22,21 +22,21 @@
<link
rel="icon"
type="image/png"
href="asset-image-logo-512.svg"
href="asset_image_logo_512.svg"
/>
<title>JSLint: Help</title>
<style>
@font-face {
font-display: swap;
font-family: "Programma";
font-weight: bold;
src: url("asset-font-programma-bold.woff2") format("woff2");
src: url("asset_font_programma_bold.woff2") format("woff2");
}
@font-face {
font-display: swap;
font-family: "Daley";
font-weight: bold;
src: url("asset-font-daley-bold.woff2") format("woff2");
src: url("asset_font_daley_bold.woff2") format("woff2");
}
body {
background-color: seashell;
Expand Down Expand Up @@ -526,7 +526,7 @@ <h1 id=var><code>var let const</code></h1>
parameter in an outer function. Do not mix <code>var</code> and
<code>let</code>. Declare one name per statement.</p>
<h1 id=eq><code>= == ===</code></h1>
<p><span style="asset-font-variant: small-caps;">Fortran</span> made a terrible
<p><span style="asset_font_variant: small-caps;">Fortran</span> made a terrible
mistake in using the equality operator as its assignment operator. That
mistake has been replicated in most languages since then. C compounded that
mistake by making <code>==</code> its equality operator. The visual
Expand Down Expand Up @@ -812,9 +812,9 @@ <h1 id=reading>Further Reading</h1>
<center>
<p><a href="https://www.crockford.com/javascript/code.html" target="_blank">
Code Conventions for the JavaScript Programming Language.</a></p>
<a href="https://www.JSLint.com/"><img src="asset-image-logo-512.svg" height="20"></a>
<a href="https://github.com/jslint-org/jslint"><img src="asset-image-github-brands.svg" height="20"></a>
<a href="https://www.JSON.org/"><img src="asset-image-json-160.gif" height="20"></a>
<a href="https://www.JSLint.com/"><img src="asset_image_logo_512.svg" height="20"></a>
<a href="https://github.com/jslint-org/jslint"><img src="asset_image_github_brands.svg" height="20"></a>
<a href="https://www.JSON.org/"><img src="asset_image_json_160.gif" height="20"></a>
</center>
</body>
</html>
8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -10,12 +10,12 @@
it without sending it over the network."
/>
<meta name="author" content="Douglas Crockford"/>
<link rel="icon" type="image/png" href="asset-image-logo-512.svg"/>
<link rel="icon" type="image/png" href="asset_image_logo_512.svg"/>
<title>JSLint:&nbsp;The&nbsp;JavaScript&nbsp;Code Quality Tool</title>
<!-- Google Lighthouse Performance - Reduce Largest Contentful Paint. -->
<link as="script" rel="preload" href="asset-codemirror-rollup.js">
<link as="script" rel="preload" href="asset_codemirror_rollup.js">
<link rel="modulepreload" href="jslint.mjs">
<link rel="stylesheet" href="asset-codemirror-rollup.css">
<link rel="stylesheet" href="asset_codemirror_rollup.css">
<style>
/*csslint
box-model: false,
Expand Down Expand Up @@ -324,7 +324,7 @@
</fieldset>
</main>
<div id="JSLINT_REPORT_HTML"></div>
<script defer src="asset-codemirror-rollup.js"></script>
<script defer src="asset_codemirror_rollup.js"></script>
<script type="module">
// browser.mjs
// Original Author: Douglas Crockford (https://www.jslint.com).
Expand Down
2 changes: 1 addition & 1 deletion jslint.mjs
Expand Up @@ -1233,7 +1233,7 @@ async function jslint_cli({
}
if (!(
!(
/\b(?:lock|min|raw|rollup)\b/
/(?:\b|_)(?:lock|min|raw|rollup)(?:\b|_)/
).test(file2) && code && code.length < 1048576
)) {
return;
Expand Down

0 comments on commit fbce8c0

Please sign in to comment.