diff --git a/.eslintrc.json b/.eslintrc.json index 766a04d..e042348 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,31 +1,33 @@ { - "root": true, - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": [ - "airbnb-base" - ], - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "overrides": [ - { - "files": ["**/*.ts"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json" - }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "airbnb-typescript/base", - "plugin:@typescript-eslint/recommended" - ] - } - ] + "root": true, + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [ + "airbnb-base" + ], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "./tsconfig.json" + }, + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "airbnb-typescript/base", + "plugin:@typescript-eslint/recommended" + ] + } + ] } diff --git a/rollup/plugins.js b/rollup/plugins.js index d4cee1f..0d40e59 100644 --- a/rollup/plugins.js +++ b/rollup/plugins.js @@ -1,5 +1,6 @@ import path from 'path'; +/* eslint-disable import/no-extraneous-dependencies */ import postcssPluginBanner from 'postcss-banner'; import postcssPluginCssnano from 'cssnano'; import rollupPluginLicense from 'rollup-plugin-license'; @@ -8,6 +9,8 @@ import rollupPluginStrip from '@rollup/plugin-strip'; import { terser as rollupPluginTerser } from 'rollup-plugin-terser'; import rollupPluginTypescript from '@rollup/plugin-typescript'; +// TODO: remove rule after changing the Rollup config +// eslint-disable-next-line import/no-dynamic-require const pkg = require(path.join(process.cwd(), 'package.json')); const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov ${pkg.homepage}`; @@ -15,8 +18,8 @@ ${pkg.homepage}`; export const license = () => rollupPluginLicense({ banner: { commentStyle: 'ignored', - content: bannerText - } + content: bannerText, + }, }); /** @@ -31,8 +34,8 @@ export const postcss = (file = true, minify) => rollupPluginPostcss({ }), postcssPluginBanner({ banner: bannerText, - important: true - }) + important: true, + }), ], }); diff --git a/rollup/rollup.config.dev.js b/rollup/rollup.config.dev.js index 60e7e19..f60dbd2 100644 --- a/rollup/rollup.config.dev.js +++ b/rollup/rollup.config.dev.js @@ -4,7 +4,6 @@ const input = './src/index.ts'; const name = 'shareon'; const outputDir = './dev/'; - export default { input, output: { diff --git a/rollup/rollup.config.prod.js b/rollup/rollup.config.prod.js index 2d6f401..a32f3b2 100644 --- a/rollup/rollup.config.prod.js +++ b/rollup/rollup.config.prod.js @@ -1,10 +1,11 @@ -import { license, postcss, strip, terser, typescript } from './plugins'; +import { + license, postcss, strip, terser, typescript, +} from './plugins'; const input = './src/index.ts'; const name = 'shareon'; const outputDir = './dist/'; - export default { input, output: [ @@ -24,6 +25,6 @@ export default { typescript(), strip(), postcss(`${name}.min.css`, true), - license() + license(), ], }; diff --git a/tsconfig.json b/tsconfig.json index 4b9875e..9014f5e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,18 @@ { - "compilerOptions": { - "lib": [ - "dom", - "es6" - ], - "module": "ES2020", - "noImplicitAny": true, - "noImplicitReturns": true, - "target": "es5" - }, - "include": [ - "./src/**/*" + "compilerOptions": { + "lib": [ + "dom", + "es6" ], - "exclude": [ - "node_modules" - ] + "module": "ES2020", + "noImplicitAny": true, + "noImplicitReturns": true, + "target": "es5" + }, + "include": [ + "./src/**/*" + ], + "exclude": [ + "node_modules" + ] }