Skip to content

Commit

Permalink
v4.4.0 (Luxon 3.4.2)
Browse files Browse the repository at this point in the history
 * Switched to eslint (finally!)
 * Refactored everything to respect alphabetic order rule
 * Fix parsing.md docs: remove "TTT" from valid parsing tokens (#1427)
 * Fix math.md docs: add missing "leap" in "leap years" (#1438)
 * Fix zones.md docs: fix default zone name (#1394)
 * Fix DateTime.invalid documentation (#1470)
 * Fix normalize() to handle partially negative inputs (#1467)
 * Fix Info.months for Islamic calendar (#1464)
 * Added search in docs (#1481)
 * Handle invalid Durations in toHuman and toMillis (#1489)
 * Improve Duration#shiftTo and Duration#normalize now having a better handling (#1493)
  • Loading branch information
tonysamperi committed Aug 26, 2023
1 parent 2f8a7ad commit 9b0ddb6
Show file tree
Hide file tree
Showing 24 changed files with 2,872 additions and 2,256 deletions.
278 changes: 278 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"tsconfigRootDir": "./",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"extends": [
"plugin:@typescript-eslint/recommended"
],
"root": true,
"env": {
"node": true,
"jest": true
},
"ignorePatterns": [
"test/**/*"
],
"rules": {
"accessor-pairs": [
"error",
{
"getWithoutSet": true,
"setWithoutGet": true,
"enforceForClassMembers": false
}
],
"eol-last": "warn",
"grouped-accessor-pairs": [
"error",
"setBeforeGet"
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/member-ordering": [
"error",
{
"default": {
"order": "alphabetically",
"memberTypes": [
[
"set",
"get"
]
]
},
"interfaces": {
"order": "alphabetically"
},
"classes": {
"order": "alphabetically",
"memberTypes": [
[
"public-static-set",
"public-static-get"
],
[
"protected-static-set",
"protected-static-get"
],
"public-static-field",
"protected-static-field",
"private-static-field",
[
"private-static-set",
"private-static-get"
],
[
"public-decorated-set",
"public-decorated-get",
"public-instance-set",
"public-instance-get"
],
[
"protected-decorated-set",
"protected-decorated-get",
"protected-instance-set",
"protected-instance-get"
],
[
"private-decorated-set",
"private-decorated-get",
"private-instance-set",
"private-instance-get"
],
"public-field",
"protected-field",
"private-field",
"constructor",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": [
"camelCase"
]
},
{
"selector": "objectLiteralProperty",
"format": null,
"modifiers": [
"requiresQuotes"
]
},
{
"selector": "objectLiteralProperty",
"format": [
"camelCase",
"snake_case"
]
},
{
"selector": "variable",
"format": [
"camelCase"
],
"leadingUnderscore": "forbid"
},
{
"selector": "variable",
"modifiers": [
"exported"
],
"format": [
"camelCase",
"UPPER_CASE"
],
"leadingUnderscore": "forbid"
},
{
"selector": "parameter",
"format": [
"camelCase"
],
"leadingUnderscore": "forbid"
},
{
"selector": "parameter",
"modifiers": [
"unused"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require",
"trailingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": [
"public",
"static",
"readonly"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "forbid"
},
{
"selector": "memberLike",
"modifiers": [
"protected",
"static",
"readonly"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": [
"private",
"static",
"readonly"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": [
"public"
],
"format": [
"camelCase"
],
"leadingUnderscore": "forbid"
},
{
"selector": "memberLike",
"modifiers": [
"protected"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require"
},
{
"selector": "memberLike",
"modifiers": [
"private"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require"
},
{
"selector": "accessor",
"modifiers": [
"static",
"public"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "forbid"
},
{
"selector": "accessor",
"modifiers": [
"static",
"protected"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "require"
},
{
"selector": "accessor",
"modifiers": [
"static",
"private"
],
"format": [
"UPPER_CASE"
],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": [
"PascalCase"
]
},
{
"selector": "enumMember",
"format": [
"UPPER_CASE"
]
}
]
}
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 4.4.0 (Luxon 3.4.1)
* Switched to eslint (finally!)
* Refactored everything to respect alphabetic order rule
* Fix parsing.md docs: remove "TTT" from valid parsing tokens (#1427)
* Fix math.md docs: add missing "leap" in "leap years" (#1438)
* Fix zones.md docs: fix default zone name (#1394)
* Fix DateTime.invalid documentation (#1470)
* Fix normalize() to handle partially negative inputs (#1467)
* Fix Info.months for Islamic calendar (#1464)
* Added search in docs (#1481)
* Handle invalid Durations in toHuman and toMillis (#1489)
* Improve Duration#shiftTo and Duration#normalize now having a better handling (#1493)

## 4.3.1 (Luxon 3.3.0)
* Fix typings path issue (#6)[https://github.com/tonysamperi/ts-luxon/issues/6]

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
transform: {
".(ts|tsx)": "ts-jest"
},
testEnvironment: "jsdom",
testEnvironment: "node",
testRegex: "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
moduleFileExtensions: [
"ts",
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-luxon",
"version": "4.3.2",
"version": "4.4.0",
"license": "MIT",
"description": "Typescript version of the \"Immutable date wrapper\"",
"author": "Tony Samperi",
Expand Down Expand Up @@ -38,11 +38,14 @@
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-typescript": "^11.0.0",
"@types/benchmark": "^2.1.0",
"@types/jest": "^27.5.0",
"@types/jest": "^29.5.4",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"benchmark": "^2.0.0",
"codecov": "^3.0.0",
"documentation": "^14.0.0",
"jest": "^27.5.0",
"eslint": "^8.47.0",
"jest": "^29.6.4",
"rollup": "~2.33.3",
"rollup-plugin-cleaner": "^1.0.0",
"rollup-plugin-commonjs": "^10.1.0",
Expand All @@ -51,13 +54,10 @@
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "~0.29.0",
"rollup-plugin-uglify": "^6.0.4",
"ts-jest": "^27.1.3",
"ts-jest": "^29.1.1",
"tslib": "^2.0.0",
"tslint": "^6.1.3",
"tslint-consistent-codestyle": "^1.16.0",
"typedoc": "^0.23.21",
"typescript": "~4.7.4"
"typescript": "~5.0.4"
},
"sideEffects": false,
"dependencies": {}
"sideEffects": false
}
2 changes: 1 addition & 1 deletion src/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ export class DateTime {

/**
* Create an invalid DateTime.
* @param {DateTime} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent
* @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.
* @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information
* @return {DateTime}
*/
Expand Down
Loading

0 comments on commit 9b0ddb6

Please sign in to comment.