diff --git a/.eslintignore b/.eslintignore index fb18f87ee..c6c69963c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,5 +7,3 @@ packages/docs packages/examples/landing site/ -jest/ -scripts/ \ No newline at end of file diff --git a/jest/setup.js b/jest/setup.js index 3186a0f23..31b1fec4a 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -1,5 +1,3 @@ - beforeEach(() => { - console.error = jest.fn() + console.error = jest.fn(); }); - diff --git a/package.json b/package.json index dd3619d3e..2d42f2657 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,11 @@ "clean": "lerna run clean --stream", "build": "lerna run build --stream", "deploy": "./scripts/deploy.sh", - "release": "run-s clean build release:npm ", + "release": "run-s clean test lint build release:npm", "release:npm": "lerna publish", "test:watch": "jest --watch", "test": "jest", - "lint": "eslint packages --ext .js,.jsx,.ts,.tsx" + "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "devDependencies": { "@babel/cli": "^7.7.4", diff --git a/rollup.config.js b/rollup.config.js index a0fdc11bf..a19a93b93 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,11 +1,11 @@ -import path from 'path' -import resolve from 'rollup-plugin-node-resolve' -import { terser } from 'rollup-plugin-terser' -import typescript from 'rollup-plugin-typescript' -import babel from 'rollup-plugin-babel' +import path from "path"; +import resolve from "rollup-plugin-node-resolve"; +import { terser } from "rollup-plugin-terser"; +import typescript from "rollup-plugin-typescript"; +import babel from "rollup-plugin-babel"; -const shouldMinify = process.env.NODE_ENV == 'production'; -const bundle = ['@craftjs/utils', 'tslib']; +const shouldMinify = process.env.NODE_ENV === "production"; +const bundle = ["@craftjs/utils", "tslib"]; export default { input: "./src/index.ts", @@ -14,9 +14,9 @@ export default { dir: "dist/esm", format: "esm", globals: { - 'react': 'React', - 'react-dom': 'ReactDOM' - }, + react: "React", + "react-dom": "ReactDOM" + } }, { dir: "dist/cjs", @@ -24,7 +24,7 @@ export default { } ], external: id => { - return !id.startsWith('.') && !path.isAbsolute(id) && !bundle.includes(id); + return !id.startsWith(".") && !path.isAbsolute(id) && !bundle.includes(id); }, plugins: [ resolve(), @@ -33,18 +33,18 @@ export default { presets: [ ["@babel/preset-typescript"], [ - '@babel/preset-env', + "@babel/preset-env", { modules: false, targets: { - browsers: ['>0.25%, not dead'] + browsers: [">0.25%, not dead"] } } ] ], plugins: [ - '@babel/proposal-class-properties', - '@babel/proposal-object-rest-spread' + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread" ] }), shouldMinify && @@ -54,10 +54,10 @@ export default { compress: { keep_infinity: true, pure_getters: true, - passes: 10, + passes: 10 }, ecma: 5, - warnings: true, - }), + warnings: true + }) ] -} \ No newline at end of file +};