+++ /dev/null
-module.exports = {
- extends: [
- 'airbnb-base/legacy',
- 'plugin:mocha/recommended'
- ],
- parserOptions: {
- ecmaVersion: 2019,
- sourceType: 'module'
- },
- env: {
- browser: true,
- jquery: true
- },
- plugins: [
- 'svelte3',
- 'mocha'
- ],
- overrides: [
- {
- files: ['*'],
- globals: {
- L: true, // leaflet library
- Nominatim_Config: true
- },
- rules: {
- camelcase: 'off', // my_var is fine, no need for myVar
- 'func-names': 'off', // anonymous 'function()' is fine
- 'vars-on-top': 'off',
- 'new-cap': 'off', // constructor name can start lowercase (as Leaflet does)
- 'no-multiple-empty-lines': 'off',
- 'no-use-before-define': ['error', { functions: false }],
- 'padded-blocks': 'off',
- 'no-param-reassign': 'off',
- 'max-len': [
- 'error',
- 100,
- 2,
- {
- ignoreUrls: true,
- ignoreComments: false
- }
- ]
- }
- },
- {
- files: ['*.svelte'],
- processor: 'svelte3/svelte3',
- rules: {
- 'no-label-var': 'off' // eslint thinks $: (https://svelte.dev/tutorial/reactive-statements) are labels
- }
- },
- {
- files: ['test/**'],
- globals: {
- browser: true
- }
- }
- ]
-};
--- /dev/null
+// https://eslint.org/docs/latest/user-guide/configuring/configuration-files
+{
+ "extends": [
+ "airbnb-base/legacy",
+ "plugin:mocha/recommended"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 2019,
+ "sourceType": "module"
+ },
+ "env": {
+ "browser": true
+ },
+ "plugins": [
+ "svelte3",
+ "mocha"
+ ],
+ "overrides": [
+ {
+ "files": ["*"],
+ "globals": {
+ "L": true, // leaflet library
+ "Nominatim_Config": true
+ },
+ "rules": {
+ "camelcase": "off", // my_var is fine, no need for myVar
+ "func-names": "off", // anonymous "function()" is fine
+ "vars-on-top": "off",
+ "new-cap": "off", // constructor name can start lowercase (as Leaflet does)
+ "no-multiple-empty-lines": "off",
+ "no-use-before-define": ["error", { "functions": false }],
+ "padded-blocks": "off",
+ "no-param-reassign": "off",
+ "max-len": [
+ "error",
+ 100,
+ 2,
+ {
+ "ignoreUrls": true,
+ "ignoreComments": false
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.svelte"],
+ "processor": "svelte3/svelte3",
+ "rules": {
+ "no-label-var": "off" // eslint thinks $: (https://svelte.dev/tutorial/reactive-statements) are labels
+ }
+ },
+ {
+ "files": ["test/**"],
+ "globals": {
+ "browser": true
+ }
+ }
+ ]
+}
+++ /dev/null
-// https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.js
-
-'use strict';
-
-module.exports = {
- ignore: ['test/_bootstrap.js'],
- require: ['test/_bootstrap.js'],
- timeout: '5s'
-};
--- /dev/null
+// https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.json
+{
+ "ignore": ["test/_bootstrap.js"],
+ "require": ["test/_bootstrap.js"],
+ "timeout": "5s"
+}
\ No newline at end of file
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
- "lint": "eslint --quiet .*.js src/ test/",
- "lint:fix": "eslint --fix .*.js src/ test/",
+ "lint": "eslint --quiet *.js src/ test/",
+ "lint:fix": "eslint --fix *.js src/ test/",
"test": "rollup -c && mocha --recursive test/",
"start": "static-server dist"
},
import { terser } from 'rollup-plugin-terser';
import css from 'rollup-plugin-css-only';
import { readFileSync, writeFileSync } from 'fs';
+import { spawn } from 'child_process';
const production = !process.env.ROLLUP_WATCH;
return {
writeBundle() {
if (server) return;
- server = require('child_process').spawn('yarn', ['start', '-d'], {
+ server = spawn('yarn', ['start', '-d'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
}
}),
css({
- output: function (styles, styleNodes) {
+ // output: function (styles, styleNodes) {
+ output: function (styles) {
// make sure global_styles.css gets appended to bundle.css,
// not prepended.
// The ':global()' rules (https://svelte.dev/docs#style) get