Skip to content

Commit

Permalink
style(eslint/prettier): added .eslintignore and .prettierignore (has …
Browse files Browse the repository at this point in the history
…to be relative paths) (#61)

removed src from prettier's and eslint's glob, in addition to fixing linting errors introduced by
these changes.
  • Loading branch information
Omri-Levy authored Nov 5, 2022
1 parent a46fb82 commit 365f2a4
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages/config
1 change: 0 additions & 1 deletion packages/config/eslintrc.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ module.exports = {
es6: true,
},
plugins: ['@typescript-eslint'],
ignorePatterns: ['node_modules', '.eslintrc.cjs'],
};
4 changes: 4 additions & 0 deletions sdks/web-sdk/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.eslintrc.cjs
examples
2 changes: 1 addition & 1 deletion sdks/web-sdk/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ module.exports = {
settings: {
...settings,
'svelte3/typescript': require('typescript'),
}
},
};
2 changes: 2 additions & 0 deletions sdks/web-sdk/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
4 changes: 2 additions & 2 deletions sdks/web-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"test:watch": "vitest",
"test:e2e": "playwright test",
"check": "svelte-check --tsconfig ./tsconfig.json",
"format": "prettier --write \"./src/**/*.{js,svelte,html,ts}\"",
"lint": "eslint \"./src/**/*.{js,ts,svelte}\"",
"format": "prettier --write \"./**/*.{cjs,js,svelte,html,ts}\"",
"lint": "eslint \"./**/*.{cjs,js,ts,svelte}\"",
"lint:fix": "yarn lint --fix",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
Expand Down
6 changes: 3 additions & 3 deletions sdks/web-sdk/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
import "dotenv/config";
import 'dotenv/config';

/**
* See https://playwright.dev/docs/test-configuration.
Expand Down
1 change: 1 addition & 0 deletions sdks/web-sdk/tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// Otherwise causes an ESLint error
"vite.config.ts",
"vite.dev.config.ts",
"svelte.config.js",
"playwright.config.ts",
"vitest.config.ts",
"e2e"
Expand Down
12 changes: 6 additions & 6 deletions sdks/web-sdk/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig, loadEnv } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { resolve } from "path";
import dts from "vite-plugin-dts";
import type { UserConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { resolve } from 'path';
import dts from 'vite-plugin-dts';

/** @type {import("vite").UserConfig} */
export default ({ mode }) => {
export default ({ mode }: { mode: UserConfig['mode'] }) => {
console.log('building with vite...', mode);
const env = loadEnv(mode, process.cwd(), '');
return defineConfig({
Expand Down
7 changes: 4 additions & 3 deletions sdks/web-sdk/vite.dev.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defineConfig, loadEnv } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import type { UserConfig } from 'vite';
import { defineConfig, loadEnv } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';

// https://vitejs.dev/config/
export default ({ mode }) => {
export default ({ mode }: { mode: UserConfig['mode'] }) => {
console.log('VITE', mode);
const env = loadEnv(mode, process.cwd(), '');
return defineConfig({
Expand Down

0 comments on commit 365f2a4

Please sign in to comment.