Skip to content

Instantly share code, notes, and snippets.

View vadymstebakov's full-sized avatar
🇺🇦

Vadym Stebakov vadymstebakov

🇺🇦
View GitHub Profile
@vadymstebakov
vadymstebakov / .eslintrc.json
Created April 6, 2023 13:46
eslint basic config
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2020
},
"globals": {
@vadymstebakov
vadymstebakov / script.js
Created February 19, 2023 18:34
Paste this in your browser console to search for HTML elements which extend past the window's width and create a horizontal scrollbar.
function checkElemWidth(elem) {
if (elem.clientWidth > window.innerWidth) {
console.info(
"The following element has a larger width than " +
"the window’s outer width"
);
console.info(elem);
console.info("\n\n");
}
@vadymstebakov
vadymstebakov / tsconfig.json
Created January 12, 2023 10:46
tsconfig file
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"target": "ES2018",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
@vadymstebakov
vadymstebakov / commitlint.config.cjs
Created January 12, 2023 10:18
Commitlint config file
// build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
// ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
// docs: Documentation only changes
// feat: A new feature
// fix: A bug fix
// perf: A code change that improves performance
// refactor: A code change that neither fixes a bug nor adds a feature
// style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
// test: Adding missing tests or correcting existing tests
@vadymstebakov
vadymstebakov / .stylelintrc
Created January 12, 2023 10:17
Stylelint config file
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"ignoreFiles": [
".next/**/*.*",
"node_modules/**/*.*"
],
"rules": {
"string-quotes": "double",
"indentation": [
4,
@vadymstebakov
vadymstebakov / .prettierrc
Created January 12, 2023 10:16
Prettier config file
{
"printWidth": 120,
"proseWrap": "never",
"endOfLine": "lf",
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true,
"overrides": [
{
"files": ["**/*.css", "**/*.html", "**/*.svg"],
@vadymstebakov
vadymstebakov / next.config.js
Created January 12, 2023 10:15
Next.js config example
/** @type {import('next').NextConfig} */
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
openAnalyzer: false,
});
const nextConfig = {
reactStrictMode: true,
@vadymstebakov
vadymstebakov / browserslist
Created January 12, 2023 10:14
List of supported Browsers
"browserslist": [
">=1%",
"not dead",
"not op_mini all",
"not and_uc 12",
"Firefox >= 80",
"Chrome >= 80",
"Opera >= 70",
"Safari >= 14",
"Edge >= 80",
@vadymstebakov
vadymstebakov / .eslintrc
Created January 12, 2023 10:05
Eslint rules for Next.js projects with TypeScript.
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["node_modules/", ".next/"],
"extends": [
"eslint:recommended",
const eyeDropper = new EyeDropper();
const result = await eyeDropper.open();
console.log(result.sRGBHex);