Skip to content

Commit

Permalink
New build system
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Dec 17, 2023
1 parent 341fcc3 commit da0cf48
Show file tree
Hide file tree
Showing 28 changed files with 4,798 additions and 4,203 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> 1%
last 2 versions
not ie <= 8
not dead
5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
build/*.js
config/*.js
tests/unit/coverage/
/dist/
/tests/coverage/
118 changes: 88 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
const rulesDirPlugin = require('eslint-plugin-rulesdir');

rulesDirPlugin.RULES_DIR = 'build/eslint/rules/';
const utils = require('./build/utils');

module.exports = {
root: true,

env: {
browser: true,
es6: true,
node: true,
},

parser: 'vue-eslint-parser',

parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2020,
extraFileExtensions: ['.vue'],
sourceType: 'module',
},

plugins: ['@kiwiirc', 'jsdoc'],

extends: [
'plugin:vue/recommended',
'plugin:vue/vue3-recommended',
'eslint:recommended',
'@vue/airbnb',
'standard',
],
env: {
browser: true,

settings: {
'import/resolver': {
alias: {
map: [
['@', utils.pathResolve('src')],
],
extensions: ['.js', '.vue', '.json'],
},
},
},
// required to lint *.vue files
plugins: [
'rulesdir',
'vue',
],
// add your custom rules here

rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'rulesdir/class-name-prefix': 'warn',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',

'@kiwiirc/class-name-prefix': 'warn',

'class-methods-use-this': 0,
'comma-dangle': ['error', {
arrays: 'always-multiline',
Expand All @@ -36,10 +54,16 @@ module.exports = {
}],
'import/extensions': 0,
'import/no-cycle': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'import/no-unresolved': [2, {
ignore: [
// These files will not exist if lint is run before the first build
'/res/locales/available\\.json$',
'/static/locales/\\S+\\.json$',
],
}],
'import/prefer-default-export': 0,
'indent': ['error', 4],
// 'max-len': ['error', { code: 120 }],
'max-classes-per-file': 0,
'no-continue': 0,
'no-else-return': 0,
Expand All @@ -57,16 +81,28 @@ module.exports = {
'prefer-template': 0,
'quote-props': ['error', 'consistent-as-needed'],
'semi': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'vue/component-definition-name-casing': 0,
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
}],
'vue/html-indent': ['error', 4],
// 'vue/max-len': [
// 'error',
// {
// code: 120,
// template: 120,
// tabWidth: 4,
// comments: 120,
// },
// ],
'vue/max-attributes-per-line': 0,
'vue/multi-word-component-names': 0,
'vue/multiline-html-element-content-newline': 0,
'vue/no-mutating-props': 0,
'vue/no-unused-components': 0,
'vue/no-mutating-props': ['error', {
shallowOnly: true,
}],
'vue/no-v-html': 0,
'vue/one-component-per-file': 0,
'vue/require-default-prop': 0,
'vue/require-prop-types': 0,
'vue/singleline-html-element-content-newline': 0,
Expand All @@ -77,14 +113,36 @@ module.exports = {
'vuejs-accessibility/interactive-supports-focus': 0,
'vuejs-accessibility/label-has-for': 0,
'vuejs-accessibility/mouse-events-have-key-events': 0,

// TODO vue3
'multiline-ternary': 0,
'vue/comma-dangle': 0,
'vue/key-spacing': 0,
'vue/no-template-target-blank': 0,
'vue/no-unused-components': 0,
'vue/object-curly-newline': 0,
'vue/object-curly-spacing': 0,
'vue/operator-linebreak': 0,
'vue/quote-props': 0,
'vue/space-infix-ops': 0,
'vue/v-on-event-hyphenation': 0,
},
overrides: [{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
{
files: ['webpack.config.js', 'build/**/*.js'],
rules: {
'import/no-extraneous-dependencies': 0,
'no-console': 0,
},
},
}],
],
};
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
Expand Down
34 changes: 30 additions & 4 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
extends: ['stylelint-config-standard', 'stylelint-config-standard-scss', 'stylelint-config-recess-order'],
overrides: [
{
files: ['**/*.html'],
files: ['**/*.vue', '**/*.html'],
customSyntax: 'postcss-html',
},
],
rules: {
'alpha-value-notation': null,
'color-function-notation': null,
'declaration-block-no-redundant-longhand-properties': null,
'declaration-no-important': true,
'indentation': 4,
'media-feature-range-notation': null,
'no-descending-specificity': null,
'no-empty-first-line': null,
'number-max-precision': null,
'order/properties-order': null,
'property-no-vendor-prefix': null,
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'each',
'else',
'extends',
'for',
'function',
'if',
'ignores',
'include',
'media',
'mixin',
'return',
'use',

// Font Awesome 4
'fa-font-path',
],
},
],
'scss/double-slash-comment-empty-line-before': null,
'scss/double-slash-comment-whitespace-inside': null,
'selector-class-pattern': null,
'shorthand-property-no-redundant-values': null,
'string-quotes': 'single',
},
};
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"rvest.vs-code-prettier-eslint"
]
}
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"stylelint.validate": [
"vue",
"css",
"less",
"sass",
"scss",
"postcss"
],
"search.exclude": {
"**/dist": true
},
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[css]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
}
15 changes: 2 additions & 13 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
presets: [
[
'@vue/cli-plugin-babel/preset',
'@babel/preset-env',
{
useBuiltIns: 'entry',
modules: 'commonjs',
Expand All @@ -10,16 +10,5 @@ module.exports = {
],
],
plugins: [['@babel/plugin-transform-runtime', { corejs: 3, useESModules: true }]],
env: {
test: {
plugins: [
[
'istanbul',
{
exclude: ['**/*.spec.js'],
},
],
],
},
},
exclude: [/core-js/],
};
Loading

0 comments on commit da0cf48

Please sign in to comment.