Skip to content

Commit

Permalink
remove beta babel; fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgoli committed Aug 1, 2018
1 parent 1d498b4 commit 91a22ff
Show file tree
Hide file tree
Showing 10 changed files with 3,069 additions and 4,054 deletions.
6,292 changes: 2,877 additions & 3,415 deletions dist/es5/rrule.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es5/rrule.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/es6/nlp/parsetext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es6/nlp/parsetext.js.map

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions package.json
Expand Up @@ -6,7 +6,7 @@
"license": "SEE LICENSE IN LICENSE",
"babel": {
"presets": [
"@babel/preset-env"
"babel-preset-env"
]
},
"keywords": [
Expand All @@ -17,28 +17,26 @@
"rfc"
],
"author": "Jakub Roztocil and Lars Schöning",
"main": "dist/es5",
"main": "dist/es6",
"module": "dist/es6",
"repository": {
"type": "git",
"url": "git://github.com/jakubroztocil/rrule.git"
},
"scripts": {
"build": "yarn lint && tsc && webpack",
"lint": "yarn tslint --fix src/**/*.ts test/**/*.ts",
"lint": "yarn tslint --project . --fix --config tslint.json",
"test": "yarn lint && TZ=UTC TS_NODE_PROJECT=tsconfig.test.json mocha --compilers ts:ts-node/register"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.55",
"@babel/preset-env": "^7.0.0-beta.55",
"@types/assert": "^0.0.31",
"@types/chai": "^4.1.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.5.4",
"babel-cli": "^6.26.0",
"babel-core": "7.0.0-bridge.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"babel-preset-env": "^1.6.1",
"chai": "^4.1.2",
"coffee-loader": "^0.9.0",
"coffeescript": "^2.3.1",
Expand All @@ -50,7 +48,7 @@
"ts-loader": "^4.4.2",
"ts-node": "^7.0.0",
"tslint": "^5.11.0",
"tslint-config-standard": "^7.1.0",
"tslint-eslint-rules": "^5.3.1",
"typescript": "^3.0.1",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/nlp/parsetext.ts
Expand Up @@ -24,7 +24,7 @@ class Parser {
}

isDone () {
return this.done && this.symbol == null
return this.done && this.symbol === null
}

nextSymbol () {
Expand All @@ -44,7 +44,7 @@ class Parser {
rule = this.rules[name]
match = rule.exec(p.text)
if (match) {
if (best == null || match[0].length > best[0].length) {
if (best === null || match[0].length > best[0].length) {
best = match
bestSymbol = name
}
Expand Down
17 changes: 5 additions & 12 deletions tsconfig.json
Expand Up @@ -8,17 +8,10 @@
"noEmitOnError": true,
"target": "es6",
"jsx": "react",
"lib": ["es6"],
"baseUrl": ".",
"rootDirs": [
"./src/",
"./test/",
]
"rootDirs": ["./src/", "./test/"]
},
"include": [
"./src/**/*",
],
"exclude": [
"node_modules",
"./test/**/*"
]
}
"include": ["./src/**/*"],
"exclude": ["node_modules", "./test/**/*"]
}
146 changes: 144 additions & 2 deletions tslint.json
@@ -1,3 +1,145 @@
{
"extends": "tslint-config-standard"
}
"extends": ["tslint-eslint-rules"],
"rules": {
// TSLint rules.
"no-internal-module": true,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
],
"await-promise": true,
"curly": [true, "ignore-same-line"],
"deprecation": true,
"label-position": true,
"no-arg": true,
"no-conditional-assignment": true,
"no-duplicate-imports": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-reference-import": true,
"no-return-await": true,
"no-switch-case-fall-through": true,
"no-unused-expression": [
true,
"allow-fast-null-checks",
"allow-tagged-template"
],
"no-use-before-declare": true,
"no-var-keyword": true,
"radix": true,
"space-within-parens": [true, 0],
"triple-equals": [true, "allow-null-check"],
"use-isnan": true,
"eofline": true,
"ter-indent": [
true,
2,
{
"SwitchCase": 1
}
],
"no-trailing-whitespace": true,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"class-name": true,
"comment-format": [true, "check-space"],
"jsdoc-format": true,
"new-parens": true,
"no-angle-bracket-type-assertion": true,
"no-consecutive-blank-lines": true,
"no-floating-promises": true,
"no-misused-new": true,
"no-string-throw": true,
"no-unnecessary-qualifier": true,
"no-unnecessary-type-assertion": true,
"one-line": [
true,
"check-catch",
"check-finally",
"check-else",
"check-open-brace",
"check-whitespace"
],
"one-variable-per-declaration": true,
"quotemark": [true, "single", "avoid-escape", "jsx-single"],
"semicolon": [true, "never"],
"space-before-function-paren": [true, "always"],
"unified-signatures": true,
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
// 'check-module',
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock"
],
// TSLint ESLint rules.
"no-constant-condition": [
true,
{
"checkLoops": false
}
],
"no-control-regex": true,
"no-duplicate-case": true,
"no-empty-character-class": true,
"no-ex-assign": true,
"no-extra-boolean-cast": true,
"no-inner-declarations": [true, "functions"],
"no-invalid-regexp": true,
"ter-no-irregular-whitespace": true,
"no-regex-spaces": true,
"ter-no-sparse-arrays": true,
"ter-func-call-spacing": [true, "never"],
"no-unexpected-multiline": true,
"valid-typeof": true,
"ter-arrow-spacing": [
true,
{
"before": true,
"after": true
}
],
"no-multi-spaces": true,
"handle-callback-err": [true, "^(err|error)$"],
"block-spacing": [true, "always"],
"brace-style": [
true,
"1tbs",
{
"allowSingleLine": true
}
],
"object-curly-spacing": [true, "always"]
}
}
39 changes: 21 additions & 18 deletions webpack.config.js
Expand Up @@ -8,37 +8,40 @@ const paths = {
styles: path.resolve(__dirname, "demo/demo.css"),
template: path.resolve(__dirname, "demo/index.html")
},
demoDist: path.resolve(__dirname, "dist", "demo"),
es5: path.resolve(__dirname, "dist", "es5")
demoDist: path.resolve(__dirname, "dist"),
es5: path.resolve(__dirname, "dist", "es5"),
es6: path.resolve(__dirname, "dist", "es6")
};

const rruleConfig = {
entry: {
index: './dist/es6/index.js'
index: path.join(paths.es6, "index.js")
},
output: {
filename: 'rrule.js',
filename: "rrule.js",
path: paths.es5,
library: 'rrule',
libraryTarget: 'umd',
globalObject: 'typeof self !== \'undefined\' ? self : this'
library: "rrule",
libraryTarget: "umd",
globalObject: "typeof self !== 'undefined' ? self : this"
},
devtool: 'source-map',
mode: 'production',
devtool: "source-map",
mode: "production",
module: {
rules: [{
test: /\.js?$/,
use: 'babel-loader',
exclude: /node_modules/
}]
rules: [
{
test: /\.js?$/,
use: "babel-loader",
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.js']
extensions: [".js"]
},
optimization: {
minimize: false
}
}
};

const demoConfig = {
entry: {
Expand All @@ -55,7 +58,7 @@ const demoConfig = {
},
output: {
filename: "demo.js",
path: paths.dist
path: paths.demoDist
},
plugins: [
new webpack.ProvidePlugin({
Expand All @@ -65,7 +68,7 @@ const demoConfig = {
new CopyWebpackPlugin([
{
from: paths.demo.styles,
to: paths.dist
to: paths.demoDist
}
]),
new HtmlWebpackPlugin({
Expand Down

0 comments on commit 91a22ff

Please sign in to comment.