isaacscript-lint 1.0.150 → 1.0.153
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/README.md +13 -15
- package/package.json +5 -4
- package/.cspell.json +0 -18
- package/.gitattributes +0 -9
- package/.vscode/extensions.json +0 -8
- package/.vscode/settings.json +0 -16
- package/nuke.sh +0 -18
- package/publish.sh +0 -11
- package/update.sh +0 -17
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# isaacscript-lint
|
|
2
2
|
|
|
3
|
+
<!-- markdownlint-disable MD033 -->
|
|
4
|
+
|
|
3
5
|
[](https://www.npmjs.com/package/isaacscript-lint)
|
|
4
6
|
|
|
5
7
|
`isaacscript-lint` is a helper package to install all of the dependencies necessary for ESLint to work with a typical TypeScript project or a typical IsaacScript mod.
|
|
@@ -30,7 +32,7 @@ One of the key insights of [Guido van Rossum](https://en.wikipedia.org/wiki/Guid
|
|
|
30
32
|
|
|
31
33
|
[Go](https://golang.org/), the programming language designed at Google in 2009, took this concept a step further. They included a code formatter inside of the language itself, called `gofmt` (which is short for "Go formatter"). When you are coding a Go program, it will automatically format all of the code as soon as you save the file. This can be surprising and disturbing for newcomers: "Why does `gofmt` make my code ugly?!"
|
|
32
34
|
|
|
33
|
-
However, once people get used to the formatter, they realize that it saves them a
|
|
35
|
+
However, once people get used to the formatter, they realize that it saves them a _tremendous amount of time_. By ignoring all formatting and typing out code "raw", and then summoning the formatter to instantly fix everything, you can quite literally code twice as fast. Rob Pike, one of the creators of Go, famously said that "gofmt's style is no one's favorite, yet gofmt is everyone's favorite". ([This YouTube clip](https://www.youtube.com/embed/PAAkCSZUG1c?start=523&end=568) of Rob is a much-watch!)
|
|
34
36
|
|
|
35
37
|
`gofmt` is nice because it saves people from mundane code formatting. But there is also a benefit that is entirely separate and not readily apparent. When looking at other people's Go code on StackOverflow or GitHub, you realize that it looks exactly like your code. It's easy to read and comprehend. And you can copy-paste code snippets from other programs into your own applications without having to change anything! For programmers, this is not the norm, and it feels great - it's the hidden superpower of Go.
|
|
36
38
|
|
|
@@ -48,7 +50,7 @@ Historically, the the most popular style guide is the world is the [Airbnb JavaS
|
|
|
48
50
|
|
|
49
51
|
ESLint is the industry standard tool for linting in JavaScript and TypeScript. Airbnb helpfully provides an ESLint configuration with most of their style recommendations. ESLint can function in a way similar to `gofmt` by configuring your text editor to do `eslint --fix` on save. However, this has a lot of limitations. It can't automatically fix everything and leaves a lot up to the end user to fix.
|
|
50
52
|
|
|
51
|
-
[Prettier](https://prettier.io/) was released in 2017 and it has quickly become very widespread. (It could
|
|
53
|
+
[Prettier](https://prettier.io/) was released in 2017 and it has quickly become very widespread. (It could _probably_ also be considered to be industry standard in 2022.) Prettier works by completely rebuilding your code from scratch using the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree), which allows it to make much better transformations than pure ESLint can.
|
|
52
54
|
|
|
53
55
|
Because of the advantages of Prettier, we use it on top of the Airbnb config, and prefer Prettier's changes if there are any conflicts. Any ESLint rules that conflict with Prettier are turned off with [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier).
|
|
54
56
|
|
|
@@ -116,8 +118,8 @@ Create a `tsconfig.eslint.json` file in the root of your repository:
|
|
|
116
118
|
// These are ESLint-only inclusions
|
|
117
119
|
// Usually, this includes any files that are outside of your "src" directory,
|
|
118
120
|
// such as "webpack.config.js", "jest.config.js", "Gruntfile.js", and so forth
|
|
119
|
-
"./.eslintrc.js"
|
|
120
|
-
]
|
|
121
|
+
"./.eslintrc.js"
|
|
122
|
+
]
|
|
121
123
|
}
|
|
122
124
|
```
|
|
123
125
|
|
|
@@ -157,20 +159,16 @@ Furthermore, you will probably want Prettier and ESLint to be run automatically
|
|
|
157
159
|
// These are Visual Studio Code settings that should apply to this particular repository
|
|
158
160
|
{
|
|
159
161
|
"[javascript]": {
|
|
160
|
-
"editor.codeActionsOnSave": [
|
|
161
|
-
"source.fixAll.eslint",
|
|
162
|
-
],
|
|
162
|
+
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
|
|
163
163
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
164
|
-
"editor.formatOnSave": true
|
|
164
|
+
"editor.formatOnSave": true
|
|
165
165
|
},
|
|
166
166
|
|
|
167
167
|
"[typescript]": {
|
|
168
|
-
"editor.codeActionsOnSave": [
|
|
169
|
-
"source.fixAll.eslint",
|
|
170
|
-
],
|
|
168
|
+
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
|
|
171
169
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
172
|
-
"editor.formatOnSave": true
|
|
173
|
-
}
|
|
170
|
+
"editor.formatOnSave": true
|
|
171
|
+
}
|
|
174
172
|
}
|
|
175
173
|
```
|
|
176
174
|
|
|
@@ -190,8 +188,8 @@ Optionally, you can also provide a hint to anyone cloning your repository that t
|
|
|
190
188
|
"recommendations": [
|
|
191
189
|
"esbenp.prettier-vscode", // The TypeScript formatter
|
|
192
190
|
"dbaeumer.vscode-eslint", // The TypeScript linter
|
|
193
|
-
"streetsidesoftware.code-spell-checker"
|
|
194
|
-
]
|
|
191
|
+
"streetsidesoftware.code-spell-checker" // A spell-checker extension based on cspell
|
|
192
|
+
]
|
|
195
193
|
}
|
|
196
194
|
```
|
|
197
195
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-lint",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.153",
|
|
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,12 +17,12 @@
|
|
|
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.
|
|
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.
|
|
24
|
-
"eslint-plugin-jsdoc": "^39.
|
|
24
|
+
"eslint-plugin-isaacscript": "^1.0.40",
|
|
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",
|
|
27
28
|
"eslint-plugin-sort-exports": "^0.6.0",
|
package/.cspell.json
DELETED
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/.vscode/extensions.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// These are Visual Studio Code extensions that are intended to be used with this particular
|
|
2
|
-
// repository
|
|
3
|
-
// https://go.microsoft.com/fwlink/?LinkId=827846
|
|
4
|
-
{
|
|
5
|
-
"recommendations": [
|
|
6
|
-
"streetsidesoftware.code-spell-checker", // A spell-checker extension based on cspell
|
|
7
|
-
]
|
|
8
|
-
}
|
package/.vscode/settings.json
DELETED
|
@@ -1,16 +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
|
-
// Linux line endings are used in this project
|
|
12
|
-
"files.eol": "\n",
|
|
13
|
-
|
|
14
|
-
// Automatically removing all trailing whitespace when saving a file
|
|
15
|
-
"files.trimTrailingWhitespace": true,
|
|
16
|
-
}
|
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 depedencies."
|
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
|