Skip to content

Commit a3a2372

Browse files
committed
Apply linter rules
This is as per pull request guidelines
1 parent a3e16cb commit a3a2372

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ If you frequently need to update your story, pasting the content into `story.js`
4242
Once the server is running, use the [other boilerplate](https://github.com/y-lohse/inkjs/blob/master/templates/browser_with_server) and place your story content inside `story.json`. Behind the scenes, the only difference is that we load the JSON file via ajax before creating the story:
4343

4444
```javascript
45-
fetch("story.json")
46-
.then(function (response) {
47-
return response.text();
48-
})
49-
.then(function (storyContent) {
50-
story = new inkjs.Story(storyContent);
51-
continueStory();
52-
});
45+
fetch('story.json')
46+
.then(function (response) {
47+
return response.text();
48+
})
49+
.then(function (storyContent) {
50+
story = new inkjs.Story(storyContent);
51+
continueStory();
52+
});
5353
```
5454

5555
## Using node.js
@@ -65,14 +65,14 @@ Require the module: `var Story = require('inkjs').Story;`.
6565
You can load the json file using a simple call to `require`:
6666

6767
```javascript
68-
var json = require("./ink_file.json");
68+
var json = require('./ink_file.json');
6969
```
7070

7171
You can also load it using `fs`. In that case, please note that inklecate outputs a json file encoded **with** BOM, and node isn't very good at handling that.
7272

7373
```javascript
74-
var fs = require("fs");
75-
var json = fs.readFileSync("./ink_file.json", "UTF-8").replace(/^\uFEFF/, ""); //strips the BOM
74+
var fs = require('fs');
75+
var json = fs.readFileSync('./ink_file.json', 'UTF-8').replace(/^\uFEFF/, ''); //strips the BOM
7676
```
7777

7878
### Starting a story
@@ -97,10 +97,10 @@ There are a few very minor API differences between ink C# and inkjs:
9797
On platforms that do not support [ES2015 Proxies](https://kangax.github.io/compat-table/es6/) (basically node.js v5, IE 11, Safari 9 and everything below), you can't directly read and write variables to the story state. Instead you will have to use the `$` function:
9898

9999
```javascript
100-
_inkStory.variablesState.$("player_health", 100);
100+
_inkStory.variablesState.$('player_health', 100);
101101
//instead of _inkStory.variablesState["player_health"] = 100;
102102

103-
var health = _inkStory.variablesState.$("player_health");
103+
var health = _inkStory.variablesState.$('player_health');
104104
//instead of var health = _inkStory.variablesState["player_health"];
105105
```
106106

@@ -109,14 +109,14 @@ var health = _inkStory.variablesState.$("player_health");
109109
`EvaluateFunction()` lets you evaluate an ink function from within your javascript. The "normal" call is the same than in C#:
110110

111111
```javascript
112-
var result = EvaluateFunction("my_ink_function", ["arg1", "arg2"]);
112+
var result = EvaluateFunction('my_ink_function', ['arg1', 'arg2']);
113113
//result is the return value of my_ink_function("arg1", "arg2")
114114
```
115115

116116
However, if you also wish to retrieve the text that `my_ink_function` output, you need to call it like this:
117117

118118
```javascript
119-
var result = EvaluateFunction("my_ink_function", ["arg1", "arg2"], true);
119+
var result = EvaluateFunction('my_ink_function', ['arg1', 'arg2'], true);
120120
//now result is an object with two properties:
121121
// result.returned is the return value of my_ink_function("arg1", "arg2")
122122
// result.output is the text that was written to the output while the function was evaluated
@@ -140,7 +140,7 @@ Usage: inklecate <options> <ink file>
140140
### online compiler
141141

142142
```javascript
143-
const story = (new inkjs.Compiler(`Hello World`)).Compile()
143+
const story = new inkjs.Compiler(`Hello World`).Compile();
144144
// story is an inkjs.Story that can be played right away
145145

146146
const jsonBytecode = story.ToJson();

docs/working-with-typescript-and-webpack.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ In Webpack 5, static resources are loaded with [Asset Modules](https://webpack.j
1111
Here we load `.ink` files and inline their content into the script. This is most useful for programs which unconditionally use a single Ink file.
1212

1313
```javascript
14-
rules: [
15-
{
16-
test: /\.ink$/i,
17-
type: 'asset/source',
18-
},
19-
// ... and then the rest of your rules
20-
]
14+
rules: [
15+
{
16+
test: /\.ink$/i,
17+
type: 'asset/source',
18+
},
19+
// ... and then the rest of your rules
20+
];
2121
```
2222

2323
We can then `import` (or `require`) the ink file and compile it.
@@ -43,8 +43,8 @@ Create one, such as `global.d.ts` in the top level of your source code, which re
4343

4444
```typescript
4545
declare module '*.ink' {
46-
const value: string;
47-
export default value;
46+
const value: string;
47+
export default value;
4848
}
4949
```
5050

0 commit comments

Comments
 (0)