native-document 1.0.160 → 1.0.162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/eslint.config.js CHANGED
@@ -1,22 +1,40 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
1
+ import js from '@eslint/js';
3
2
 
4
3
  export default [
5
- { ignores: ['dist'] },
6
4
  js.configs.recommended,
7
5
  {
8
- files: ['**/*.{js}'],
9
6
  languageOptions: {
10
7
  ecmaVersion: 'latest',
11
- globals: globals.browser,
12
- parserOptions: {
13
- ecmaVersion: 'latest',
14
- sourceType: 'module',
8
+ sourceType: 'module',
9
+ globals: {
10
+ window: 'readonly',
11
+ document: 'readonly',
12
+ navigator: 'readonly',
13
+ console: 'readonly',
14
+ setTimeout: 'readonly',
15
+ clearTimeout: 'readonly',
16
+ setInterval: 'readonly',
17
+ clearInterval: 'readonly',
15
18
  },
16
19
  },
17
- plugins: {},
18
20
  rules: {
19
- ...js.configs.recommended.rules,
21
+ // Possible errors
22
+ 'no-console': 'warn',
23
+ 'no-unused-vars': 'warn',
24
+ 'no-undef': 'error',
25
+
26
+ // Best practices
27
+ 'eqeqeq': 'error', // always === instead of ==
28
+ 'no-var': 'error', // always let/const
29
+ 'prefer-const': 'warn', // prefer const when not reassigned
30
+ 'no-duplicate-imports': 'error',
31
+
32
+ // Style
33
+ 'semi': ['error', 'always'],
34
+ 'quotes': ['warn', 'single'],
35
+ 'indent': ['warn', 4],
36
+ 'comma-dangle': ['warn', 'always-multiline'],
20
37
  },
38
+ ignores: ['node_modules', 'dist'],
21
39
  },
22
- ]
40
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.160",
3
+ "version": "1.0.162",
4
4
  "sideEffects": [
5
5
  "index.js",
6
6
  "elements.js",
@@ -10,6 +10,7 @@ import {ObservableObject} from "./ObservableObject";
10
10
  import "./observable-helpers/observable.is-to";
11
11
  import './observable-helpers/observable.prototypes';
12
12
  import ObservableResource from "./ObservableResource";
13
+ import {Formatters} from "../utils/formatters";
13
14
  /**
14
15
  *
15
16
  * @param {*} value
@@ -40,6 +41,10 @@ Observable.useValueProperty = function(propertyName = 'value') {
40
41
  });
41
42
  };
42
43
 
44
+ Observable.setLocale = function(locale) {
45
+ Formatters.locale = locale.__$Observable ? locale : Observable(locale);
46
+ };
47
+
43
48
 
44
49
  /**
45
50
  *
@@ -32,7 +32,7 @@ export function RouterComponent(router, container) {
32
32
  };
33
33
 
34
34
  const removeLastNodeInserted = () => {
35
- $lastNodeInserted.remove();
35
+ $lastNodeInserted?.remove();
36
36
  };
37
37
 
38
38
  const cleanContainer = () => {