Skip to content

Commit

Permalink
FLUID-6253: Updated linting to use gpii-grunt-lint-all.
Browse files Browse the repository at this point in the history
Performed linting tasks.
  • Loading branch information
jobara committed Sep 4, 2018
1 parent 374ade3 commit 10fdd80
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
src/static/lib/infusion
src/static/lib/infusion
2 changes: 1 addition & 1 deletion .eslintrc-md.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"plugins": [
"markdown"
]
}
}
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"plugins": [
"markdown"
]
}
}
61 changes: 21 additions & 40 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,33 @@
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
eslint: {
js: {
src: [ "./src/**/*.js", "./tests/**/*.js","./*.js" ]
lintAll: {
options: {
config: {
"first-header-h1": false // Docpad takes care of this for us.
}
},
md: {
options: {
configFile: ".eslintrc-md.json"
},
src: [ "./*.md","./src/documents/**/*.md" ]
sources: {
md: ["./*.md", "./src/**/*.md", "./tests/**/*.md", "!./src/static/lib"],
js: ["./*.js", "./src/**/*.js", "./tests/**/*.js", "!./src/static/lib"],
json: ["./*.json", "./.*.json", "./src/**/*.json", "tests/**/*.json", "!./src/static/lib"],
json5: ["./*.json5", "./src/**/*.json5", "tests/**/*.json5", "!./src/static/lib"],
other: ["./.*"]
}
},
jsonlint: {
src: ["./src/**/*.json", "tests/**/*.json", "./*.json"]
},
json5lint: {
src: ["./src/**/*.json5", "tests/**/*.json5", "./*.json5"]
},
mdjsonlint: {
src: ["./*.md", "./**/*.md", "!./node_modules/**"]
},
markdownlint: {
full: {
options: {
config: {
// See https://github.com/DavidAnson/markdownlint#rules--aliases for rule names and meanings.
"no-duplicate-header": false, // We use duplicate nested headers, as in section 1 and 2 both have the same sub-section name.
"no-trailing-punctuation": false, // This catches headings that are questions, which seems wrong.
"first-header-h1": false, // Docpad takes care of this for us.
"first-line-h1": false, // Docpad also takes care of this for us.
"header-style": { style: "atx" }, // Although we use a mix, in discussion with various team members, we agreed to try this for now.
"no-inline-html": false, // Obviously we need HTML
"line-length": false,
"ol-prefix": {style: "ordered"} // 1. 2. 3. etc
}
},
src: ["./*.md", "src/documents/**/*.md"]
options: {
config: {
// See https://github.com/DavidAnson/markdownlint#rules--aliases for rule names and meanings.
"first-header-h1": false, // Docpad takes care of this for us.
"first-line-h1": false, // Docpad also takes care of this for us.
"line-length": false
}
}
},
mdlint: ["./*.md", "src/documents/**/*.md"]
}
});

grunt.loadNpmTasks("grunt-jsonlint");
grunt.loadNpmTasks("fluid-grunt-json5lint");
grunt.loadNpmTasks("fluid-grunt-eslint");
grunt.loadNpmTasks("grunt-markdownlint");
grunt.loadNpmTasks("gpii-grunt-mdjson-lint");
grunt.loadNpmTasks("gpii-grunt-lint-all");

grunt.registerTask("lint", "Apply eslint, jsonlint, json5lint, and markdownlint", ["eslint:js", "jsonlint", "markdownlint", "eslint:md", "mdjsonlint"]);
grunt.registerTask("lint", "Perform all standard lint checks.", ["lint-all"]);
};
68 changes: 31 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
{
"name": "infusion-docs",
"version": "1.5.0",
"description": "Infusion Documentation",
"license": "CC-BY-3.0",
"repository": "https://github.com/fluid-project/infusion-docs",
"scripts": {
"docpad": "docpad run --env static --out out",
"deploy": "docpad deploy-ghpages --env static",
"pretest": "docpad generate --env static --out out",
"test": "node tests/all-tests.js"
},
"dependencies": {
"urijs": "1.19.0",
"docpad-plugin-ghpages": "2.6.1",
"docpad-plugin-handlebars": "2.4.0",
"docpad-plugin-highlightjs": "2.5.0",
"docpad-plugin-markit": "2.4.0",
"fs-extra": "4.0.2",
"markdown-it-anchor": "4.0.0"
},
"devDependencies": {
"eslint": "4.9.0",
"eslint-config-fluid": "1.1.0",
"eslint-plugin-markdown": "1.0.0-beta.6",
"fluid-grunt-eslint": "18.1.2",
"fluid-grunt-json5lint": "1.0.0",
"gpii-express": "1.0.11",
"gpii-grunt-mdjson-lint": "1.0.0-dev.20171024T123903Z.3c91988",
"grunt": "1.0.1",
"grunt-jsonlint": "1.1.0",
"grunt-markdownlint": "1.0.42",
"infusion": "3.0.0-dev.20171006T195039Z.a128358",
"jsdom": "11.3.0",
"kettle": "1.7.0",
"node-jqunit": "1.1.7",
"request": "2.83.0"
}
"name": "infusion-docs",
"version": "1.5.0",
"description": "Infusion Documentation",
"license": "CC-BY-3.0",
"repository": "https://github.com/fluid-project/infusion-docs",
"scripts": {
"docpad": "docpad run --env static --out out",
"deploy": "docpad deploy-ghpages --env static",
"pretest": "docpad generate --env static --out out",
"test": "node tests/all-tests.js"
},
"dependencies": {
"urijs": "1.19.0",
"docpad-plugin-ghpages": "2.6.1",
"docpad-plugin-handlebars": "2.4.0",
"docpad-plugin-highlightjs": "2.5.0",
"docpad-plugin-markit": "2.4.0",
"fs-extra": "4.0.2",
"markdown-it-anchor": "4.0.0"
},
"devDependencies": {
"eslint-config-fluid": "1.3.0",
"gpii-grunt-lint-all": "1.0.5-dev.20180904T103657Z.c351ca9",
"gpii-express": "1.0.11",
"grunt": "1.0.1",
"infusion": "3.0.0-dev.20171006T195039Z.a128358",
"jsdom": "11.3.0",
"kettle": "1.7.0",
"node-jqunit": "1.1.7",
"request": "2.83.0"
}
}
2 changes: 1 addition & 1 deletion src/documents/ContextAwareness.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,4 @@ fluid.contextAware.makeAdaptation({
gradeNames: "fluid.uploader.compatibility.1_2"
}
});
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,4 @@ For the switch:
display: inline-block;
}
}
```
```
41 changes: 22 additions & 19 deletions src/documents/tutorial-userInterfaceOptions/UserInterfaceOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,39 @@ The rest of this tutorial will explain each of these steps in detail.
3. Your `infusion` folder will include a single file containing all of the JavaScript you need (`infusion-uiOptions.js`), HTML templates, CSS files, and other components to get UI Options to work. You will later link to these files in your HTML files.
4. Now that `infusion` is in your project directory, you can delete the `infusion-uiOptions-2.0.0.zip` (or similar name) from your download directory.

### Full Infusion library via NPM
### Full Infusion library via NPM

<strong>Note: </strong>
This section assumes that you have [NPM/node.js](https://nodejs.org/en/) installed in your computer.

1. Get Infusion by typing the following in the command line (A new directory called `node_modules/infusion` will be created as a result):
```
npm install infusion
```
1. Get Infusion by typing the following in the command line (A new directory called `node_modules/infusion` will be created as a result):

```bash
npm install infusion
```

2. Using the command line, change directory into the infusion directory that's been created within node_modules.
* On Windows type:

```bash
cd node_modules\infusion
```

* On Mac type:

```bash
cd node_modules/infusion
```

* On Windows type:
```cmd
cd node_modules\infusion
```
* On Mac type:
```bash
cd node_modules/infusion
```
3. Now build Infusion by typing in:

```
npm install
grunt
```
4. This will create a "products" directory in the Infusion directory. Within the `project_name/node_modules/infusion/products` directory, there is now a ZIP file called "infusion-all-2.0.0.zip" (the exact filename may be a little different depending on the release of Infusion available at the time you download it).
```bash
npm install
grunt
```

4. This will create a "products" directory in the Infusion directory. Within the `project_name/node_modules/infusion/products` directory, there is now a ZIP file called "infusion-all-2.0.0.zip" (the exact filename may be a little different depending on the release of Infusion available at the time you download it).
5. Unzip this file using your preferred Unzipping program. Now move the resulting "infusion" directory to a location within your project.<div class="infusion-docs-note"><strong>Note:</strong> In this guide we will use the directory `my-project/lib/`.</div>

6. Your infusion folder will include a single file containing all of the JavaScript you need (infusion-all.js), HTML templates, CSS files, and other components to get UI Options to work. You will later link to these files in your HTML files.

## Prepare your page
Expand Down

0 comments on commit 10fdd80

Please sign in to comment.