isaacscript-lint 1.0.151 → 1.0.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-lint",
3
- "version": "1.0.151",
3
+ "version": "1.0.154",
4
4
  "description": "An updatable linting dependency container for IsaacScript and TypeScript projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "license": "MIT",
10
10
  "author": "Zamiell",
11
+ "files": [],
11
12
  "dependencies": {
12
13
  "@prettier/plugin-xml": "^2.2.0",
13
14
  "@typescript-eslint/eslint-plugin": "^5.25.0",
@@ -16,11 +17,11 @@
16
17
  "eslint": "^8.15.0",
17
18
  "eslint-config-airbnb-base": "^15.0.0",
18
19
  "eslint-config-airbnb-typescript": "^17.0.0",
19
- "eslint-config-isaacscript": "^1.0.77",
20
+ "eslint-config-isaacscript": "^1.0.79",
20
21
  "eslint-config-prettier": "^8.5.0",
21
22
  "eslint-plugin-eslint-comments": "^3.2.0",
22
23
  "eslint-plugin-import": "^2.26.0",
23
- "eslint-plugin-isaacscript": "^1.0.40",
24
+ "eslint-plugin-isaacscript": "^1.0.41",
24
25
  "eslint-plugin-jsdoc": "^39.3.0",
25
26
  "eslint-plugin-no-implicit-map-set-loops": "^1.0.3",
26
27
  "eslint-plugin-only-warn": "^1.0.3",
package/.cspell.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3
- "version": "0.2",
4
- "files": [
5
- "**"
6
- ],
7
- "ignorePaths": [
8
- ".git/**",
9
- "dist/**",
10
- "node_modules/**"
11
- ],
12
- "words": [
13
- "dbaeumer",
14
- "esbenp",
15
- "gofmt",
16
- "Gruntfile",
17
- "isaacscript",
18
- "prettierignore",
19
- "prettierrc",
20
- "rossum",
21
- "rustfmt",
22
- "tiamtowtdi",
23
- "zamiell"
24
- ]
25
- }
package/.gitattributes DELETED
@@ -1,9 +0,0 @@
1
- # Prevent Windows systems from cloning this repository with "\r\n" line endings.
2
- core.autocrlf=false
3
-
4
- # Prevent people from making merge commits:
5
- # https://www.endoflineblog.com/gitflow-considered-harmful
6
- pull.rebase=true
7
-
8
- # Convert all files to use "\n" line endings.
9
- * text=auto eol=lf
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- # Ignore compiled output.
2
- dist
3
-
4
- # The VSCode CSpell plugin causes the file to become unformatted whenever a new word is added.
5
- .cspell.json
package/.prettierrc.js DELETED
@@ -1,30 +0,0 @@
1
- // This is the configuration file for Prettier, the auto-formatter:
2
- // https://prettier.io/docs/en/configuration.html
3
- module.exports = {
4
- // Always print trailing commas:
5
- // https://prettier.io/docs/en/options.html#trailing-commas
6
- // The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.). However,
7
- // always having trailing commas is objectively better. The Airbnb style guide agrees:
8
- // https://github.com/airbnb/javascript#commas--dangling
9
- // Prettier itself also acknowledges Nik Graf's blog in their official blog:
10
- // https://prettier.io/blog/2020/03/21/2.0.0.html
11
- // https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
12
- // Prettier will change the default in the future:
13
- // https://github.com/prettier/prettier/issues/9369
14
- trailingComma: "all",
15
-
16
- // We want to always use "lf" to be consistent with all platforms.
17
- endOfLine: "lf",
18
-
19
- // Allow proper formatting of JSONC files:
20
- // https://github.com/prettier/prettier/issues/5708
21
- overrides: [
22
- {
23
- files: ["**/.vscode/*.json", "**/tsconfig.json", "**/tsconfig.*.json"],
24
- options: {
25
- parser: "json5",
26
- quoteProps: "preserve",
27
- },
28
- },
29
- ],
30
- };
@@ -1,9 +0,0 @@
1
- // These are Visual Studio Code extensions that are intended to be used with this particular
2
- // repository: https://go.microsoft.com/fwlink/?LinkId=827846
3
- {
4
- "recommendations": [
5
- "esbenp.prettier-vscode", // The TypeScript formatter
6
- "dbaeumer.vscode-eslint", // The TypeScript linter
7
- "streetsidesoftware.code-spell-checker", // A spell-checker extension based on cspell
8
- ],
9
- }
@@ -1,66 +0,0 @@
1
- // These are Visual Studio Code settings that should apply to this particular repository.
2
- {
3
- // ----------------
4
- // Vanilla settings
5
- // ----------------
6
-
7
- // This matches the Airbnb JavaScript style guide.
8
- "editor.rulers": [100],
9
- "editor.tabSize": 2,
10
-
11
- // We want to always use "lf" to be consistent with all platforms.
12
- "files.eol": "\n",
13
-
14
- // Automatically removing all trailing whitespace when saving a file.
15
- "files.trimTrailingWhitespace": true,
16
-
17
- // Configure glob patterns for excluding files and folders in full text searches and quick open.
18
- // (File extensions must be specified or the glob won't work properly.)
19
- "search.exclude": {
20
- "dist/**/*.ts": true,
21
- "dist/**/*.js": true,
22
- "dist/**/*.json": true,
23
- },
24
-
25
- // -----------------
26
- // Language settings
27
- // -----------------
28
-
29
- // By default, VSCode will not automatically fill-in function arguments.
30
- "javascript.suggest.completeFunctionCalls": true,
31
- "typescript.suggest.completeFunctionCalls": true,
32
-
33
- // Automatically run the formatter when certain files are saved.
34
- "[javascript]": {
35
- "editor.codeActionsOnSave": ["source.fixAll.eslint"],
36
- "editor.defaultFormatter": "esbenp.prettier-vscode",
37
- "editor.formatOnSave": true,
38
- "editor.tabSize": 2,
39
- },
40
- "[typescript]": {
41
- "editor.codeActionsOnSave": ["source.fixAll.eslint"],
42
- "editor.defaultFormatter": "esbenp.prettier-vscode",
43
- "editor.formatOnSave": true,
44
- "editor.tabSize": 2,
45
- },
46
- "[json]": {
47
- "editor.defaultFormatter": "esbenp.prettier-vscode",
48
- "editor.formatOnSave": true,
49
- "editor.tabSize": 2,
50
- },
51
- "[jsonc]": {
52
- "editor.defaultFormatter": "esbenp.prettier-vscode",
53
- "editor.formatOnSave": true,
54
- "editor.tabSize": 2,
55
- },
56
- "[yaml]": {
57
- "editor.defaultFormatter": "esbenp.prettier-vscode",
58
- "editor.formatOnSave": true,
59
- "editor.tabSize": 2,
60
- },
61
- "[markdown]": {
62
- "editor.defaultFormatter": "esbenp.prettier-vscode",
63
- "editor.formatOnSave": true,
64
- "editor.tabSize": 2,
65
- },
66
- }
@@ -1,67 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script:
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- TEMPLATE_FILES_FILE_NAME="check-file-updates.txt"
10
- TEMPLATE_FILES_PATH="$DIR/$TEMPLATE_FILES_FILE_NAME"
11
-
12
- # Do nothing if the metadata file does not exist.
13
- if ! test -f "$TEMPLATE_FILES_PATH"; then
14
- echo "The \"$TEMPLATE_FILES_FILE_NAME\" file does not exist. Skipping checks."
15
- exit 0
16
- fi
17
-
18
- ONE_OR_MORE_FAILURES=0
19
- for FILE_SPECIFICATION in $(cat "$TEMPLATE_FILES_PATH"); do
20
- if [[ "$FILE_SPECIFICATION" =~ (.+):(.+) ]]; then
21
- LOCAL_FILE=${BASH_REMATCH[1]}
22
- REMOTE_FILE=${BASH_REMATCH[2]}
23
- STATIC_DIRECTORY="static-alt"
24
- else
25
- LOCAL_FILE=$FILE_SPECIFICATION
26
- REMOTE_FILE=$FILE_SPECIFICATION
27
- STATIC_DIRECTORY="static"
28
- fi
29
-
30
- echo "Checking for an updated version of: $LOCAL_FILE"
31
- TMP_FILE_PATH="/tmp/base-file"
32
- URL="https://raw.githubusercontent.com/IsaacScript/isaacscript/main/file-templates/$STATIC_DIRECTORY/$REMOTE_FILE"
33
- curl "$URL" --output "$TMP_FILE_PATH" --silent --show-error
34
- if grep "^404: Not Found" "$TMP_FILE_PATH" --silent; then
35
- echo
36
- echo "Failed to find the following remote file:"
37
- echo "$URL"
38
- exit 1
39
- fi
40
-
41
- FILE_PATH="$DIR/$LOCAL_FILE"
42
- if test -f "$FILE_PATH"; then
43
- set +e
44
- if ! cmp "$FILE_PATH" "$TMP_FILE_PATH" --silent; then
45
- echo
46
- echo "File \"$LOCAL_FILE\" is out of date. Get the updated version here:"
47
- echo "$URL"
48
- echo
49
- diff "$FILE_PATH" "$TMP_FILE_PATH"
50
- echo
51
- ONE_OR_MORE_FAILURES=1
52
- fi
53
- set -e
54
- else
55
- echo "File \"$FILE_PATH\" does not exist! Change the \"$TEMPLATE_FILES_FILE_NAME\" file."
56
- ONE_OR_MORE_FAILURES=1
57
- fi
58
-
59
- rm -f "$TMP_FILE_PATH"
60
- done
61
-
62
- if [ $ONE_OR_MORE_FAILURES -ne "0" ]; then
63
- echo "One or more files was not valid."
64
- exit 1
65
- fi
66
-
67
- echo "All core files up to date!"
@@ -1,7 +0,0 @@
1
- .vscode/extensions.json:.vscode/extensions-typescript.json
2
- .vscode/settings.json:.vscode/settings-typescript.json
3
- .gitattributes
4
- .prettierignore:.prettierignore-base
5
- .prettierrc.js:.prettierrc-base.js
6
- check-file-updates.sh:check-file-updates.sh
7
- check-orphaned-words.sh
@@ -1,58 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script:
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- REPO_ROOT="$DIR"
10
- cd "$REPO_ROOT"
11
-
12
- # Do nothing if the configuration file does not exist.
13
- CSPELL_CONFIG_NAME=".cspell.json"
14
- CSPELL_CONFIG_PATH="$REPO_ROOT/$CSPELL_CONFIG_NAME"
15
- if ! test -f "$CSPELL_CONFIG_PATH"; then
16
- echo "The \"$CSPELL_CONFIG_NAME\" file does not exist. Skipping checks."
17
- exit 0
18
- fi
19
-
20
- # Do nothing if the configuration file does not have any words in it.
21
- if ! grep -q '"words": ' "$CSPELL_CONFIG_PATH"; then
22
- echo "The \"$CSPELL_CONFIG_NAME\" file does not have any whitelisted words in it. Skipping checks."
23
- exit 0
24
- fi
25
-
26
- # Make a list of every misspelled word without any custom words.
27
- # We need to move the configuration path temporarily or else the cspell command won't work properly.
28
- CSPELL_CONFIG_WORDS=$(cat "$CSPELL_CONFIG_PATH" | python -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))")
29
- CSPELL_CONFIG_WITHOUT_WORDS=$(cat "$CSPELL_CONFIG_PATH" | python -c "import sys, json; config = json.load(sys.stdin); del config['words']; print(json.dumps(config))")
30
- CSPELL_CONFIG_PATH_TEMP="$REPO_ROOT/.cspell-temp.json"
31
- mv "$CSPELL_CONFIG_PATH" "$CSPELL_CONFIG_PATH_TEMP"
32
- echo "$CSPELL_CONFIG_WITHOUT_WORDS" > "$CSPELL_CONFIG_PATH"
33
- MISSPELLED_WORDS_PATH="/tmp/misspelled-words.txt"
34
- npx cspell lint --no-progress --no-summary --unique --words-only | sort --ignore-case --unique > "$MISSPELLED_WORDS_PATH"
35
- mv "$CSPELL_CONFIG_PATH_TEMP" "$CSPELL_CONFIG_PATH"
36
-
37
- # Check that each ".cspell.json" word is actually being used.
38
- echo "Checking for orphaned CSpell configuration words in: $CSPELL_CONFIG_PATH"
39
-
40
- ONE_OR_MORE_FAILURES=0
41
- set +e
42
- for LINE in $CSPELL_CONFIG_WORDS; do
43
- LINE_TRIMMED=$(echo "$LINE" | xargs)
44
- if ! grep "$LINE_TRIMMED" "$MISSPELLED_WORDS_PATH" --ignore-case --quiet; then
45
- echo "The following word in the CSpell config is not being used: $LINE_TRIMMED"
46
- ONE_OR_MORE_FAILURES=1
47
- fi
48
- done
49
- set -e
50
-
51
- rm -f "$MISSPELLED_WORDS_PATH"
52
-
53
- if [ $ONE_OR_MORE_FAILURES -ne "0" ]; then
54
- echo "CSpell configuration words are not valid."
55
- exit 1
56
- fi
57
-
58
- echo "CSpell configuration words are valid."
package/lint.sh DELETED
@@ -1,22 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script:
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- cd "$DIR"
10
-
11
- # Step 1 - Use Prettier to check formatting.
12
- npx prettier --check .
13
-
14
- # Step 2 - Spell check every file using cspell.
15
- # We use "--no-progress" and "--no-summary" because we want to only output errors.
16
- npx cspell --no-progress --no-summary
17
-
18
- # Step 3 - Check for orphaned words.
19
- bash "$DIR/check-orphaned-words.sh"
20
-
21
- # Step 4 - Check for base file updates.
22
- bash "$DIR/check-file-updates.sh"
package/nuke.sh DELETED
@@ -1,18 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- PACKAGE_LOCK="$DIR/package-lock.json"
10
- rm -f "$PACKAGE_LOCK"
11
- echo "Successfully deleted: $PACKAGE_LOCK"
12
-
13
- NODE_MODULES="$DIR/node_modules"
14
- rm -rf "$NODE_MODULES"
15
- echo "Successfully deleted: $NODE_MODULES"
16
-
17
- npm install
18
- echo "Successfully reinstalled Node dependencies."
package/publish.sh DELETED
@@ -1,11 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- cd "$DIR"
10
- pip install publish-npm --upgrade --quiet
11
- publish-npm "$@"
package/update.sh DELETED
@@ -1,17 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e # Exit on any errors
4
-
5
- # Get the directory of this script
6
- # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
-
9
- cd "$DIR"
10
-
11
- PACKAGE_JSON="$DIR/package.json"
12
- OLD_HASH=$(md5sum "$PACKAGE_JSON")
13
- npx npm-check-updates --upgrade --packageFile "$PACKAGE_JSON"
14
- NEW_HASH=$(md5sum "$PACKAGE_JSON")
15
- if [[ $OLD_HASH != $NEW_HASH ]]; then
16
- npm install
17
- fi