Skip to content

Commit

Permalink
Add scripts in 'build' directory to linting config (#7676)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops authored Oct 29, 2021
1 parent 671c7c8 commit 1b89c0a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function buildDocs() {

// Note to Vladimir: Iván's never gonna uncomment the following line. He's
// too proud of the little leaves around the code.
//doc.setLeadingChar('@');
// doc.setLeadingChar('@');

// Leaflet uses a couple of non-standard documentable things. They are not
// important enough to be classes/namespaces of their own, and should
Expand Down
10 changes: 5 additions & 5 deletions build/integrity.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ console.log('dist/leaflet.css: ', integrityCss.toString());

var docConfig = fs.readFileSync('docs/_config.yml').toString();

docConfig = docConfig.
replace(/latest_leaflet_version:.*/, 'latest_leaflet_version: ' + version).
replace(/integrity_hash_source:.*/, 'integrity_hash_source: "' + integritySrc.toString() + '"').
replace(/integrity_hash_uglified:.*/, 'integrity_hash_uglified: "' + integrityUglified.toString() + '"').
replace(/integrity_hash_css:.*/, 'integrity_hash_css: "' + integrityCss.toString() + '"');
docConfig = docConfig
.replace(/latest_leaflet_version:.*/, 'latest_leaflet_version: ' + version)
.replace(/integrity_hash_source:.*/, 'integrity_hash_source: "' + integritySrc.toString() + '"')
.replace(/integrity_hash_uglified:.*/, 'integrity_hash_uglified: "' + integrityUglified.toString() + '"')
.replace(/integrity_hash_css:.*/, 'integrity_hash_css: "' + integrityCss.toString() + '"');

// console.log('New jekyll docs config: \n', docConfig);

Expand Down
8 changes: 4 additions & 4 deletions build/rollup-config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Config file for running Rollup in "normal" mode (non-watch)

import rollupGitVersion from 'rollup-plugin-git-version'
import json from 'rollup-plugin-json'
import gitRev from 'git-rev-sync'
import pkg from '../package.json'
import rollupGitVersion from 'rollup-plugin-git-version';
import json from 'rollup-plugin-json';
import gitRev from 'git-rev-sync';
import pkg from '../package.json';

let {version} = pkg;
let release;
Expand Down
4 changes: 2 additions & 2 deletions build/rollup-watch-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Config file for running Rollup in "watch" mode
// This adds a sanity check to help ourselves to run 'rollup -w' as needed.

import rollupGitVersion from 'rollup-plugin-git-version'
import gitRev from 'git-rev-sync'
import rollupGitVersion from 'rollup-plugin-git-version';
import gitRev from 'git-rev-sync';

const branch = gitRev.branch();
const rev = gitRev.short();
Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test": "karma start ./spec/karma.conf.js",
"build": "npm run rollup && npm run uglify",
"release": "./build/publish.sh",
"lint": "eslint src spec/suites docs/docs/js",
"lint": "eslint src spec/suites docs/docs/js build",
"lintfix": "npm run lint -- --fix",
"rollup": "rollup -c build/rollup-config.js",
"watch": "rollup -w -c build/rollup-watch-config.js",
Expand Down Expand Up @@ -93,7 +93,18 @@
"allowShortCircuit": true
}
]
}
},
"overrides": [
{
"files": ["build/**/*"],
"env": {
"node": true
},
"rules": {
"global-require": 0
}
}
]
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 1b89c0a

Please sign in to comment.