Reformat files

pull/12/head
Nikita Karamov 2020-06-26 15:51:34 +02:00
parent 05cd1d874e
commit c2bf29fff2
No known key found for this signature in database
GPG Key ID: E40DFE6E993540FF
5 changed files with 57 additions and 52 deletions

View File

@ -1,31 +1,33 @@
{ {
"root": true, "root": true,
"env": { "env": {
"browser": true, "browser": true,
"es6": true, "es6": true,
"node": true "node": true
}, },
"extends": [ "extends": [
"airbnb-base" "airbnb-base"
], ],
"parserOptions": { "parserOptions": {
"ecmaVersion": 2020, "ecmaVersion": 2020,
"sourceType": "module" "sourceType": "module"
}, },
"overrides": [ "overrides": [
{ {
"files": ["**/*.ts"], "files": [
"parser": "@typescript-eslint/parser", "**/*.ts"
"parserOptions": { ],
"project": "./tsconfig.json" "parser": "@typescript-eslint/parser",
}, "parserOptions": {
"plugins": [ "project": "./tsconfig.json"
"@typescript-eslint" },
], "plugins": [
"extends": [ "@typescript-eslint"
"airbnb-typescript/base", ],
"plugin:@typescript-eslint/recommended" "extends": [
] "airbnb-typescript/base",
} "plugin:@typescript-eslint/recommended"
] ]
}
]
} }

View File

@ -1,5 +1,6 @@
import path from 'path'; import path from 'path';
/* eslint-disable import/no-extraneous-dependencies */
import postcssPluginBanner from 'postcss-banner'; import postcssPluginBanner from 'postcss-banner';
import postcssPluginCssnano from 'cssnano'; import postcssPluginCssnano from 'cssnano';
import rollupPluginLicense from 'rollup-plugin-license'; 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 { terser as rollupPluginTerser } from 'rollup-plugin-terser';
import rollupPluginTypescript from '@rollup/plugin-typescript'; 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 pkg = require(path.join(process.cwd(), 'package.json'));
const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov const bannerText = `${pkg.name} v${pkg.version} by Nikita Karamov
${pkg.homepage}`; ${pkg.homepage}`;
@ -15,8 +18,8 @@ ${pkg.homepage}`;
export const license = () => rollupPluginLicense({ export const license = () => rollupPluginLicense({
banner: { banner: {
commentStyle: 'ignored', commentStyle: 'ignored',
content: bannerText content: bannerText,
} },
}); });
/** /**
@ -31,8 +34,8 @@ export const postcss = (file = true, minify) => rollupPluginPostcss({
}), }),
postcssPluginBanner({ postcssPluginBanner({
banner: bannerText, banner: bannerText,
important: true important: true,
}) }),
], ],
}); });

View File

@ -4,7 +4,6 @@ const input = './src/index.ts';
const name = 'shareon'; const name = 'shareon';
const outputDir = './dev/'; const outputDir = './dev/';
export default { export default {
input, input,
output: { output: {

View File

@ -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 input = './src/index.ts';
const name = 'shareon'; const name = 'shareon';
const outputDir = './dist/'; const outputDir = './dist/';
export default { export default {
input, input,
output: [ output: [
@ -24,6 +25,6 @@ export default {
typescript(), typescript(),
strip(), strip(),
postcss(`${name}.min.css`, true), postcss(`${name}.min.css`, true),
license() license(),
], ],
}; };

View File

@ -1,18 +1,18 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": [ "lib": [
"dom", "dom",
"es6" "es6"
],
"module": "ES2020",
"noImplicitAny": true,
"noImplicitReturns": true,
"target": "es5"
},
"include": [
"./src/**/*"
], ],
"exclude": [ "module": "ES2020",
"node_modules" "noImplicitAny": true,
] "noImplicitReturns": true,
"target": "es5"
},
"include": [
"./src/**/*"
],
"exclude": [
"node_modules"
]
} }