-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
5,871 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = tab | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.min.*] | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Action | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
ci: | ||
name: CI | ||
if: ${{ ! contains(github.event.head_commit.message, '[skip') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18' | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Lint | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Env files | ||
.env | ||
.env.* | ||
.htaccess | ||
!.env.example | ||
!.env.test | ||
|
||
# Log files | ||
*.log* | ||
logs | ||
|
||
# Editor directories and files | ||
*.njsproj | ||
*.ntvs* | ||
*.sln | ||
*.suo | ||
*.sw? | ||
.fleet | ||
.idea | ||
.vscode | ||
|
||
# Node dependencies | ||
node_modules | ||
yarn.lock | ||
|
||
# Cache | ||
*cache* | ||
.DS_Store | ||
Thumbs.db | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.* | ||
*.md | ||
*.yml | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
# shared | ||
A set of common modules (components, configurations, utilities) for any project | ||
# shared [![npm version](https://img.shields.io/npm/v/efiand-shared.svg)](https://www.npmjs.com/package/efiand-shared) | ||
|
||
Набор общих модулей (компонентов, конфигураций, утилит) для любого проекта (Vanilla JS, Vue, Nuxt, Svelte). | ||
|
||
Разработка внутри внешнего приложения в режиме HMR: | ||
|
||
```js | ||
// vite.config.ts | ||
|
||
import { watchNodeModules } from 'efiand-shared/config/vite'; | ||
|
||
export default { | ||
plugins: [watchNodeModules(['efiand-shared'])], | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pluginVue from 'eslint-plugin-vue'; | ||
import vueTsEslintConfig from '@vue/eslint-config-typescript'; | ||
|
||
/** @type {import('eslint').Linter.Config['rules']} */ | ||
export const eslintSharedCustomRules = { | ||
'no-console': [ | ||
process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
{ allow: ['error'] }, | ||
], | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'vue/component-name-in-template-casing': [ | ||
'error', | ||
'kebab-case', | ||
{ | ||
registeredComponentsOnly: false, | ||
ignores: [], | ||
}, | ||
], | ||
'vue/html-indent': ['error', 'tab'], | ||
'vue/html-self-closing': 'off', | ||
'vue/max-attributes-per-line': 'off', | ||
'vue/singleline-html-element-content-newline': 'off', | ||
}; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export const eslintConfigs = [ | ||
{ | ||
files: ['**/*.{js,ts,vue}'], | ||
ignores: ['**/dist/**', '*.min.*'], | ||
}, | ||
...pluginVue.configs['flat/strongly-recommended'], | ||
...vueTsEslintConfig(), | ||
{ | ||
plugins: { | ||
vue: pluginVue, | ||
}, | ||
rules: eslintSharedCustomRules, | ||
}, | ||
]; | ||
|
||
/** @type {(configs?: import('eslint').Linter.Config[]) => import('eslint').Linter.Config[]} */ | ||
export const createEslintConfig = (configs = []) => [ | ||
...eslintConfigs, | ||
...configs, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { AcceptedPlugin } from 'postcss'; | ||
|
||
declare const postcssConfig: { | ||
plugins?: readonly AcceptedPlugin[]; | ||
}; | ||
|
||
declare const postcssPlugins: { | ||
[key: string]: unknown; | ||
}; | ||
|
||
export { postcssConfig, postcssPlugins }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import autoprefixer from 'autoprefixer'; | ||
import sortMediaQueries from 'postcss-sort-media-queries'; | ||
import postcssUrl from 'postcss-url'; | ||
|
||
const postcssUrlOptions = { | ||
filter: '**/icons/*', | ||
url: 'inline', | ||
}; | ||
|
||
/** @type {{ [key: string]: unknown }}} */ | ||
export const postcssPlugins = { | ||
'autoprefixer': {}, | ||
'postcss-sort-media-queries': {}, | ||
'postcss-url': postcssUrlOptions, | ||
}; | ||
|
||
/** @type {{ plugins?: readonly import('postcss).AcceptedPlugin[] }}} */ | ||
export const postcssConfig = { | ||
plugins: [autoprefixer, sortMediaQueries(), postcssUrl(postcssUrlOptions)], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @type {import('prettier').Config} */ | ||
export const prettierConfig = { | ||
singleQuote: true, | ||
useTabs: true, | ||
trailingComma: 'all', | ||
quoteProps: 'consistent', | ||
arrowParens: 'always', | ||
singleAttributePerLine: false, | ||
htmlWhitespaceSensitivity: 'ignore', | ||
overrides: [{ files: '*.vue', options: { parser: 'vue' } }], | ||
}; | ||
|
||
export default prettierConfig; |
Oops, something went wrong.