Skip to content

Commit 384f5fe

Browse files
authored
Move source to folder & Replace standardx with eslint & Update .npmignore (openhab#321)
* Move all source code files to a new `src` folder to improve structure of the repo. * Replace `standardx` linter with `eslint` using the standard rules. This allows more flexibility and works around the fact, that `standardx` seems outdated regarding our eslint version. * Update .npmignore to exclude more development related files and therefore decrease package size by a few kilobytes. --------- Signed-off-by: Florian Hotze <[email protected]>
1 parent 903599f commit 384f5fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2501
-2601
lines changed

.eslintrc

-10
This file was deleted.

.eslintrc.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
extends: 'eslint-config-standard',
3+
rules: {
4+
semi: ["error", "always"],
5+
"no-extra-semi": "error",
6+
"func-style": ["error", "declaration", { "allowArrowFunctions": true }]
7+
},
8+
globals: {
9+
Java: "readonly"
10+
},
11+
parserOptions: {
12+
ecmaVersion: 2022
13+
}
14+
}

.npmignore

+13-10
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
.github
44
.idea
5-
.markdownlint.yaml
65
.vscode
7-
CODEOWNERS
8-
coverage
9-
DEPLOY.md
6+
build
7+
dist
108
doc
119
docs
12-
docs_config.json
13-
dist
14-
images
15-
jest.config.js
16-
openhab-*.tgz
17-
out
1810
test
1911

12+
types/index.d.ts*
13+
14+
.eslintrc.js
15+
.gitignore
16+
.markdownlint.yaml
17+
.nvmrc
18+
CODEOWNERS
19+
CONTRIBUTING.md
20+
DEPLOY.md
21+
openhab-*.tgz
22+
typeOfArguments.js

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ After you read the following sections, please read the [deployment instructions]
162162

163163
### Code style
164164

165-
openhab-js is using [`standardx`](https://github.com/standard/standardx) for code linting and formatting.
165+
openhab-js is using [`eslint`](https://eslint.org/) with the rules from [JavaScript standard style](https://standardjs.com/) and some overrides for code linting and formatting.
166166

167167
Code-style is enforced when checks run on a PR.
168168

build/@openhab-globals.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
(function (global) {
44
'use strict';
5-
Object.assign(globalThis, require('../index'));
5+
Object.assign(globalThis, require('../src/index'));
66
// Support legacy NodeJS libraries
77
globalThis.global = globalThis;
88
})(this);

build/jsdoc.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"template": "./node_modules/docdash"
3232
},
3333
"docdash": {
34-
"sort": false,
34+
"sort": true,
3535
"static": true,
3636
"sectionOrder": [
3737
"Namespaces",

build/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// Change this to match your project
3-
"include": ["../**/*.js"],
3+
"include": ["../src/**/*.js"],
44
"exclude": [
55
"../test/**",
66
"../coverage/**",

build/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path');
22
const TerserPlugin = require('terser-webpack-plugin');
33

44
module.exports = {
5-
entry: './index.js',
5+
entry: './src/index.js',
66
mode: 'production',
77
performance: {
88
hints: false,

0 commit comments

Comments
 (0)