[Build] Add linter
This commit is contained in:
@@ -9,7 +9,9 @@ const renderColourAsHex = util.renderColourAsHex;
|
|||||||
// │ Theme generator (returns theme as object) │
|
// │ Theme generator (returns theme as object) │
|
||||||
// ╰───────────────────────────────────────────────╯
|
// ╰───────────────────────────────────────────────╯
|
||||||
// ───────────────────────────────────────────────────────────────────
|
// ───────────────────────────────────────────────────────────────────
|
||||||
module.exports.generateTheme = ( theme, wallpaper, lockpaper, palette ) => {
|
module.exports.generateTheme = (
|
||||||
|
theme, wallpaper, lockpaper, palette
|
||||||
|
) => {
|
||||||
return {
|
return {
|
||||||
'wallpaper-path': wallpaper,
|
'wallpaper-path': wallpaper,
|
||||||
'lockpaper-path': lockpaper,
|
'lockpaper-path': lockpaper,
|
||||||
@@ -49,14 +51,30 @@ module.exports.generateTheme = ( theme, wallpaper, lockpaper, palette ) => {
|
|||||||
'colour-accent-rgba-007': renderColourAsRGBA( palette[ 0 ], 0.07 ),
|
'colour-accent-rgba-007': renderColourAsRGBA( palette[ 0 ], 0.07 ),
|
||||||
'colour-accent-hyprland': util.renderColourAsRGBAHex( palette[ 0 ], 0.8 ),
|
'colour-accent-hyprland': util.renderColourAsRGBAHex( palette[ 0 ], 0.8 ),
|
||||||
// ───────────────────────────────────────────────────────────────────
|
// ───────────────────────────────────────────────────────────────────
|
||||||
'colour-accent-gradient-1-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 1, gradientMultipliers[ theme ] ) ),
|
'colour-accent-gradient-1-hex': renderColourAsHex( util.getGradientColour(
|
||||||
'colour-accent-gradient-2-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 2, gradientMultipliers[ theme ] ) ),
|
palette[ 0 ], 1, gradientMultipliers[ theme ]
|
||||||
'colour-accent-gradient-3-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 3, gradientMultipliers[ theme ] ) ),
|
) ),
|
||||||
'colour-accent-gradient-4-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 4, gradientMultipliers[ theme ] ) ),
|
'colour-accent-gradient-2-hex': renderColourAsHex( util.getGradientColour(
|
||||||
'colour-accent-gradient-5-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 5, gradientMultipliers[ theme ] ) ),
|
palette[ 0 ], 2, gradientMultipliers[ theme ]
|
||||||
'colour-accent-gradient-inverse-1-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 1, 1 / gradientMultipliers[ theme ] ) ),
|
) ),
|
||||||
'colour-accent-gradient-inverse-2-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 1, 1 / gradientMultipliers[ theme ] ) ),
|
'colour-accent-gradient-3-hex': renderColourAsHex( util.getGradientColour(
|
||||||
'colour-accent-gradient-inverse-3-hex': renderColourAsHex( util.getGradientColour( palette[ 0 ], 1, 1 / gradientMultipliers[ theme ] ) ),
|
palette[ 0 ], 3, gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
'colour-accent-gradient-4-hex': renderColourAsHex( util.getGradientColour(
|
||||||
|
palette[ 0 ], 4, gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
'colour-accent-gradient-5-hex': renderColourAsHex( util.getGradientColour(
|
||||||
|
palette[ 0 ], 5, gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
'colour-accent-gradient-inverse-1-hex': renderColourAsHex( util.getGradientColour(
|
||||||
|
palette[ 0 ], 1, 1 / gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
'colour-accent-gradient-inverse-2-hex': renderColourAsHex( util.getGradientColour(
|
||||||
|
palette[ 0 ], 1, 1 / gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
'colour-accent-gradient-inverse-3-hex': renderColourAsHex( util.getGradientColour(
|
||||||
|
palette[ 0 ], 1, 1 / gradientMultipliers[ theme ]
|
||||||
|
) ),
|
||||||
|
|
||||||
// ── Secondary accent ─────────────────────────────────────────────
|
// ── Secondary accent ─────────────────────────────────────────────
|
||||||
'colour-accent-2-hex': renderColourAsHex( palette[ 1 ] ),
|
'colour-accent-2-hex': renderColourAsHex( palette[ 1 ] ),
|
||||||
@@ -154,9 +172,9 @@ module.exports.generateTheme = ( theme, wallpaper, lockpaper, palette ) => {
|
|||||||
// ┌ ┐
|
// ┌ ┐
|
||||||
// │ Path to this repo on disk │
|
// │ Path to this repo on disk │
|
||||||
// └ ┘
|
// └ ┘
|
||||||
'path-to-dotfiles': __dirname.slice(0, __dirname.length - 5),
|
'path-to-dotfiles': __dirname.slice( 0, __dirname.length - 5 ),
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// ───────────────────────────────────────────────────────────────────
|
// ───────────────────────────────────────────────────────────────────
|
||||||
@@ -171,74 +189,265 @@ const gradientMultipliers = {
|
|||||||
'light': 1.1,
|
'light': 1.1,
|
||||||
'bright': 1.15,
|
'bright': 1.15,
|
||||||
'test': 0.75
|
'test': 0.75
|
||||||
}
|
};
|
||||||
const colours = {
|
const colours = {
|
||||||
foreground: {
|
'foreground': {
|
||||||
'nordic': [ 200, 220, 255 ],
|
'nordic': [
|
||||||
'deep-dark': [ 230, 230, 230 ],
|
200,
|
||||||
'material': [ 255, 255, 255 ], // TODO: Will be calculated by material theme generator
|
220,
|
||||||
'light': [ 40, 40, 40 ],
|
255
|
||||||
'bright': [ 0, 0, 0 ],
|
],
|
||||||
'test': [ 0, 0, 0 ],
|
'deep-dark': [
|
||||||
|
230,
|
||||||
|
230,
|
||||||
|
230
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
40,
|
||||||
|
40,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'foreground-accent': {
|
'foreground-accent': {
|
||||||
'nordic': [ 255, 255, 255 ],
|
'nordic': [
|
||||||
'deep-dark': [ 255, 255, 255 ],
|
255,
|
||||||
'material': [ 200, 200, 200 ], // TODO: Will be calculated by material theme generator
|
255,
|
||||||
'light': [ 0, 0, 0 ],
|
255
|
||||||
'bright': [ 50, 50, 50 ],
|
],
|
||||||
'test': [ 0, 0, 0 ],
|
'deep-dark': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
200,
|
||||||
|
200,
|
||||||
|
200
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
50,
|
||||||
|
50,
|
||||||
|
50
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
},
|
},
|
||||||
background: {
|
'background': {
|
||||||
'nordic': [ 10, 10, 15 ],
|
'nordic': [
|
||||||
'deep-dark': [ 20, 20, 20 ],
|
10,
|
||||||
'material': [ 30, 30, 30 ], // TODO: Will be calculated by material theme generator
|
10,
|
||||||
'light': [ 230, 230, 230 ],
|
15
|
||||||
'bright': [ 255, 255, 255 ],
|
],
|
||||||
'test': [ 255, 255, 255 ],
|
'deep-dark': [
|
||||||
|
20,
|
||||||
|
20,
|
||||||
|
20
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
30,
|
||||||
|
30,
|
||||||
|
30
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
230,
|
||||||
|
230,
|
||||||
|
230
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'background-alternative': {
|
'background-alternative': {
|
||||||
'nordic': [ 20, 20, 25 ],
|
'nordic': [
|
||||||
'deep-dark': [ 30, 30, 30 ],
|
20,
|
||||||
'material': [ 40, 40, 40 ], // TODO: Will be calculated by material theme generator
|
20,
|
||||||
'light': [ 210, 210, 210 ],
|
25
|
||||||
'bright': [ 230, 230, 230 ],
|
],
|
||||||
'test': [ 255, 255, 0 ] // brown
|
'deep-dark': [
|
||||||
|
30,
|
||||||
|
30,
|
||||||
|
30
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
40,
|
||||||
|
40,
|
||||||
|
40
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
210,
|
||||||
|
210,
|
||||||
|
210
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
230,
|
||||||
|
230,
|
||||||
|
230
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
0
|
||||||
|
] // brown
|
||||||
},
|
},
|
||||||
'background-tertiary': {
|
'background-tertiary': {
|
||||||
'nordic': [ 0, 0, 0 ],
|
'nordic': [
|
||||||
'deep-dark': [ 45, 45, 45 ],
|
0,
|
||||||
'material': [ 0, 0, 0 ], // TODO: Will be calculated by material theme generator
|
0,
|
||||||
'light': [ 180, 180, 180 ],
|
0
|
||||||
'bright': [ 200, 200, 200 ],
|
],
|
||||||
'test': [ 255, 0, 255 ] // purple
|
'deep-dark': [
|
||||||
|
45,
|
||||||
|
45,
|
||||||
|
45
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
180,
|
||||||
|
180,
|
||||||
|
180
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
200,
|
||||||
|
200,
|
||||||
|
200
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
255,
|
||||||
|
0,
|
||||||
|
255
|
||||||
|
] // purple
|
||||||
},
|
},
|
||||||
shadow: {
|
'shadow': {
|
||||||
'nordic': [ 0, 0, 2 ],
|
'nordic': [
|
||||||
'deep-dark': [ 40, 40, 40 ],
|
0,
|
||||||
'material': [ 30, 30, 30 ], // TODO: Will be calculated by material theme generator
|
0,
|
||||||
'light': [ 190, 190, 190 ],
|
2
|
||||||
'bright': [ 150, 150, 150 ],
|
],
|
||||||
'test': [ 120, 0, 0 ] // dark red
|
'deep-dark': [
|
||||||
|
40,
|
||||||
|
40,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
30,
|
||||||
|
30,
|
||||||
|
30
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
190,
|
||||||
|
190,
|
||||||
|
190
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
150,
|
||||||
|
150,
|
||||||
|
150
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
120,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
] // dark red
|
||||||
},
|
},
|
||||||
inactive: {
|
'inactive': {
|
||||||
'nordic': [ 200, 200, 200 ],
|
'nordic': [
|
||||||
'deep-dark': [ 200, 200, 200 ],
|
200,
|
||||||
'material': [ 200, 200, 200 ], // TODO: Will be calculated by material theme generator
|
200,
|
||||||
'light': [ 65, 65, 65 ],
|
200
|
||||||
'bright': [ 60, 60, 60 ],
|
],
|
||||||
'test': [ 150, 150, 150 ]
|
'deep-dark': [
|
||||||
|
200,
|
||||||
|
200,
|
||||||
|
200
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
200,
|
||||||
|
200,
|
||||||
|
200
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
65,
|
||||||
|
65,
|
||||||
|
65
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
150,
|
||||||
|
150,
|
||||||
|
150
|
||||||
|
]
|
||||||
},
|
},
|
||||||
'inactive-background': {
|
'inactive-background': {
|
||||||
'nordic': [ 0, 0, 0 ],
|
'nordic': [
|
||||||
'deep-dark': [ 0, 0, 0 ],
|
0,
|
||||||
'material': [ 255, 255, 255 ], // TODO: Will be calculated by material theme generator
|
0,
|
||||||
'light': [ 80, 80, 80 ],
|
0
|
||||||
'bright': [ 60, 60, 60 ],
|
],
|
||||||
'test': [ 60, 60, 60 ]
|
'deep-dark': [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
'material': [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
], // TODO: Will be calculated by material theme generator
|
||||||
|
'light': [
|
||||||
|
80,
|
||||||
|
80,
|
||||||
|
80
|
||||||
|
],
|
||||||
|
'bright': [
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60
|
||||||
|
],
|
||||||
|
'test': [
|
||||||
|
60,
|
||||||
|
60,
|
||||||
|
60
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const fonts = {
|
const fonts = {
|
||||||
'primary': {
|
'primary': {
|
||||||
'nordic': 'Comfortaa',
|
'nordic': 'Comfortaa',
|
||||||
@@ -261,20 +470,18 @@ const fonts = {
|
|||||||
'light': 'Jetbrains Mono',
|
'light': 'Jetbrains Mono',
|
||||||
'bright': 'Jetbrains Mono',
|
'bright': 'Jetbrains Mono',
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const iconTheme = {
|
const iconTheme = {
|
||||||
'nordic': 'Candy',
|
'nordic': 'Candy',
|
||||||
'deep-dark': 'Candy',
|
'deep-dark': 'Candy',
|
||||||
'material': 'Candy',
|
'material': 'Candy',
|
||||||
'light': 'Candy',
|
'light': 'Candy',
|
||||||
'bright': 'Candy'
|
'bright': 'Candy'
|
||||||
}
|
};
|
||||||
|
|
||||||
const yaziThemes = {
|
const yaziThemes = {
|
||||||
'nordic': 'tokyo-night',
|
'nordic': 'tokyo-night',
|
||||||
'deep-dark': 'vscode-dark-modern',
|
'deep-dark': 'vscode-dark-modern',
|
||||||
'material': 'dracula',
|
'material': 'dracula',
|
||||||
'light': 'vscode-light-modern',
|
'light': 'vscode-light-modern',
|
||||||
'bright': 'vscode-light-modern',
|
'bright': 'vscode-light-modern',
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,29 +1,37 @@
|
|||||||
const fs = require( 'fs' );
|
const fs = require( 'fs' );
|
||||||
|
|
||||||
const path = require( 'path' );
|
const path = require( 'path' );
|
||||||
|
|
||||||
const data = '' + fs.readFileSync( '/usr/share/themes/Material-Black-Blueberry/gtk-4.0/gtk.css' );
|
const data = '' + fs.readFileSync( '/usr/share/themes/Material-Black-Blueberry/gtk-4.0/gtk.css' );
|
||||||
|
|
||||||
let lineNumber = 1;
|
let lineNumber = 1;
|
||||||
|
|
||||||
const indexer = {};
|
const indexer = {};
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
|
for ( let i = 0; i < data.length; i++ ) {
|
||||||
const char = data[i];
|
const char = data[i];
|
||||||
|
|
||||||
if ( char === '\n' ) {
|
if ( char === '\n' ) {
|
||||||
lineNumber++;
|
lineNumber++;
|
||||||
} else if ( char === '#' ) {
|
} else if ( char === '#' ) {
|
||||||
const extract = data.substring( i );
|
const extract = data.substring( i );
|
||||||
const col = extract.slice( 0, extract.indexOf( '\n' ) );
|
const col = extract.slice( 0, extract.indexOf( '\n' ) );
|
||||||
|
|
||||||
if ( !indexer[ col ] ) {
|
if ( !indexer[ col ] ) {
|
||||||
indexer[ col ] = [];
|
indexer[ col ] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
indexer[ col ].push( lineNumber );
|
indexer[ col ].push( lineNumber );
|
||||||
} else if ( char === 'r' ) {
|
} else if ( char === 'r' ) {
|
||||||
const extract = data.substring( i );
|
const extract = data.substring( i );
|
||||||
|
|
||||||
if ( extract.slice( 0, 3 ) === 'rgb' ) {
|
if ( extract.slice( 0, 3 ) === 'rgb' ) {
|
||||||
const col = extract.slice( 0, extract.indexOf( '\n' ) );
|
const col = extract.slice( 0, extract.indexOf( '\n' ) );
|
||||||
|
|
||||||
if ( !indexer[ col ] ) {
|
if ( !indexer[ col ] ) {
|
||||||
indexer[ col ] = [];
|
indexer[ col ] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
indexer[ col ].push( lineNumber );
|
indexer[ col ].push( lineNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +40,8 @@ for (let i = 0; i < data.length; i++) {
|
|||||||
|
|
||||||
// Output
|
// Output
|
||||||
const keys = Object.keys( indexer );
|
const keys = Object.keys( indexer );
|
||||||
for (let i = 0; i < keys.length; i++) {
|
|
||||||
|
for ( let i = 0; i < keys.length; i++ ) {
|
||||||
const element = keys[i];
|
const element = keys[i];
|
||||||
|
|
||||||
if ( element.length <= 25 ) {
|
if ( element.length <= 25 ) {
|
||||||
|
|||||||
724
eslint.config.mjs
Normal file
724
eslint.config.mjs
Normal file
@@ -0,0 +1,724 @@
|
|||||||
|
import eslint from '@eslint/js';
|
||||||
|
import globals from 'globals';
|
||||||
|
import stylistic from '@stylistic/eslint-plugin';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
import typescript from '@typescript-eslint/eslint-plugin';
|
||||||
|
import vue from 'eslint-plugin-vue';
|
||||||
|
|
||||||
|
const style = {
|
||||||
|
'plugins': {
|
||||||
|
'@stylistic': stylistic,
|
||||||
|
'@stylistic/js': stylistic,
|
||||||
|
'@stylistic/ts': stylistic,
|
||||||
|
},
|
||||||
|
'files': [
|
||||||
|
'**/*.ts',
|
||||||
|
'**/*.js',
|
||||||
|
'**/*.mjs',
|
||||||
|
'**/*.cjs',
|
||||||
|
'**/*.tsx',
|
||||||
|
'**/*.jsx'
|
||||||
|
],
|
||||||
|
'rules': {
|
||||||
|
'sort-imports': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
'ignoreCase': false,
|
||||||
|
'ignoreDeclarationSort': false,
|
||||||
|
'ignoreMemberSort': false,
|
||||||
|
'memberSyntaxSortOrder': [
|
||||||
|
'none',
|
||||||
|
'all',
|
||||||
|
'multiple',
|
||||||
|
'single'
|
||||||
|
],
|
||||||
|
'allowSeparatedGroups': false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Formatting
|
||||||
|
'@stylistic/array-bracket-newline': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'multiline': true,
|
||||||
|
'minItems': 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/array-bracket-spacing': [
|
||||||
|
'error',
|
||||||
|
'always',
|
||||||
|
{
|
||||||
|
'singleValue': true,
|
||||||
|
'arraysInArrays': true,
|
||||||
|
'objectsInArrays': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/array-element-newline': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'multiline': true,
|
||||||
|
'minItems': 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/arrow-parens': [
|
||||||
|
'error',
|
||||||
|
'as-needed'
|
||||||
|
],
|
||||||
|
'@stylistic/arrow-spacing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'before': true,
|
||||||
|
'after': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/block-spacing': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/brace-style': [
|
||||||
|
'error',
|
||||||
|
'1tbs'
|
||||||
|
],
|
||||||
|
'@stylistic/comma-spacing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'before': false,
|
||||||
|
'after': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/comma-style': [
|
||||||
|
'error',
|
||||||
|
'last'
|
||||||
|
],
|
||||||
|
'@stylistic/dot-location': [
|
||||||
|
'error',
|
||||||
|
'property'
|
||||||
|
],
|
||||||
|
'@stylistic/eol-last': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/function-call-spacing': [
|
||||||
|
'error',
|
||||||
|
'never'
|
||||||
|
],
|
||||||
|
'@stylistic/function-paren-newline': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'minItems': 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/function-call-argument-newline': [
|
||||||
|
'error',
|
||||||
|
'consistent'
|
||||||
|
],
|
||||||
|
'@stylistic/implicit-arrow-linebreak': [
|
||||||
|
'error',
|
||||||
|
'beside'
|
||||||
|
],
|
||||||
|
'@stylistic/indent': [
|
||||||
|
'error',
|
||||||
|
4
|
||||||
|
],
|
||||||
|
'@stylistic/key-spacing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'beforeColon': false,
|
||||||
|
'afterColon': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/keyword-spacing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'before': true,
|
||||||
|
'after': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/lines-between-class-members': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/max-len': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
'code': 120,
|
||||||
|
'comments': 140,
|
||||||
|
'ignoreComments': false,
|
||||||
|
'ignoreUrls': true,
|
||||||
|
'ignoreStrings': false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/new-parens': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/newline-per-chained-call': [ 'error' ],
|
||||||
|
'@stylistic/no-extra-parens': [
|
||||||
|
'error',
|
||||||
|
'all',
|
||||||
|
{
|
||||||
|
'nestedBinaryExpressions': false,
|
||||||
|
'ternaryOperandBinaryExpressions': false,
|
||||||
|
'ignoreJSX': 'multi-line',
|
||||||
|
'nestedConditionalExpressions': false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/no-extra-semi': 'error',
|
||||||
|
'@stylistic/no-floating-decimal': 'error',
|
||||||
|
'@stylistic/no-mixed-operators': 'error',
|
||||||
|
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
||||||
|
'@stylistic/no-multi-spaces': 'error',
|
||||||
|
'@stylistic/no-multiple-empty-lines': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'max': 3,
|
||||||
|
'maxEOF': 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/no-tabs': 'error',
|
||||||
|
'@stylistic/no-trailing-spaces': 'error',
|
||||||
|
'@stylistic/no-whitespace-before-property': 'error',
|
||||||
|
'@stylistic/object-curly-newline': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'multiline': true,
|
||||||
|
'minProperties': 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/object-curly-spacing': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/object-property-newline': 'error',
|
||||||
|
'@stylistic/operator-linebreak': [
|
||||||
|
'error',
|
||||||
|
'before'
|
||||||
|
],
|
||||||
|
'@stylistic/one-var-declaration-per-line': 'error',
|
||||||
|
'@stylistic/padded-blocks': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'blocks': 'never',
|
||||||
|
'classes': 'always',
|
||||||
|
'switches': 'never',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
// Padding lines. The most in-depth part of this config
|
||||||
|
'@stylistic/padding-line-between-statements': [
|
||||||
|
'error',
|
||||||
|
// Variables, Constants
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'var',
|
||||||
|
'next': 'var'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'let',
|
||||||
|
'next': 'let'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'const',
|
||||||
|
'next': 'const'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'var',
|
||||||
|
'next': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'cjs-import',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'import',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'with'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'let',
|
||||||
|
'next': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'cjs-import',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'import',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'const',
|
||||||
|
'next': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'cjs-import',
|
||||||
|
'class',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'import',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// Import
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'import',
|
||||||
|
'next': 'import'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'cjs-import',
|
||||||
|
'next': 'cjs-import'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
],
|
||||||
|
'next': 'cjs-import'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'cjs-import',
|
||||||
|
'next': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
],
|
||||||
|
'next': 'import'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'import',
|
||||||
|
'next': [
|
||||||
|
'block',
|
||||||
|
'block-like',
|
||||||
|
'break',
|
||||||
|
'cjs-export',
|
||||||
|
'class',
|
||||||
|
'const',
|
||||||
|
'continue',
|
||||||
|
'debugger',
|
||||||
|
'directive',
|
||||||
|
'do',
|
||||||
|
'empty',
|
||||||
|
'export',
|
||||||
|
'expression',
|
||||||
|
'for',
|
||||||
|
'function',
|
||||||
|
'if',
|
||||||
|
'iife',
|
||||||
|
'let',
|
||||||
|
'return',
|
||||||
|
'switch',
|
||||||
|
'throw',
|
||||||
|
'try',
|
||||||
|
'var',
|
||||||
|
'while',
|
||||||
|
'with'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// If
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'if'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'if',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// For
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'for'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'for',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// While
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'while'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'while',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Functions
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'function'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'function',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Block Statements
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'block-like'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'block-like',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Switch
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'switch'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'switch',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Try-Catch
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'try'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'try',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Throw
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'throw'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'throw',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Return
|
||||||
|
{
|
||||||
|
'blankLine': 'never',
|
||||||
|
'prev': 'return',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'return'
|
||||||
|
},
|
||||||
|
// Export
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'export'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'export',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'cjs-export'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'cjs-export',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
// Classes
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': '*',
|
||||||
|
'next': 'class'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'blankLine': 'always',
|
||||||
|
'prev': 'class',
|
||||||
|
'next': '*'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@stylistic/quote-props': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/quotes': [
|
||||||
|
'error',
|
||||||
|
'single'
|
||||||
|
],
|
||||||
|
'@stylistic/rest-spread-spacing': [
|
||||||
|
'error',
|
||||||
|
'never'
|
||||||
|
],
|
||||||
|
'@stylistic/semi': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/semi-spacing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'before': false,
|
||||||
|
'after': true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/semi-style': [
|
||||||
|
'error',
|
||||||
|
'last'
|
||||||
|
],
|
||||||
|
'@stylistic/space-before-blocks': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/space-before-function-paren': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/space-in-parens': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/space-infix-ops': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'int32Hint': false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'@stylistic/space-unary-ops': 'error',
|
||||||
|
'@stylistic/spaced-comment': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/template-curly-spacing': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'@stylistic/switch-colon-spacing': 'error',
|
||||||
|
'@stylistic/wrap-iife': [
|
||||||
|
'error',
|
||||||
|
'inside'
|
||||||
|
],
|
||||||
|
'@stylistic/wrap-regex': 'error',
|
||||||
|
'@stylistic/ts/type-annotation-spacing': 'error',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** @type {import('eslint').Linter.Config} */
|
||||||
|
export default tseslint.config(
|
||||||
|
// Base JavaScript rules
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
style,
|
||||||
|
|
||||||
|
// Vue support (including TS and JSX inside SFCs)
|
||||||
|
{
|
||||||
|
'files': [ '**/*.vue' ],
|
||||||
|
'languageOptions': {
|
||||||
|
'sourceType': 'module',
|
||||||
|
'ecmaVersion': 'latest',
|
||||||
|
'globals': globals.browser,
|
||||||
|
'parserOptions': {
|
||||||
|
'parser': tseslint.parser,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'plugins': {
|
||||||
|
'vue': vue,
|
||||||
|
'@stylistic': stylistic,
|
||||||
|
'@stylistic/js': stylistic,
|
||||||
|
'@stylistic/ts': stylistic,
|
||||||
|
'@typescript-eslint': typescript,
|
||||||
|
},
|
||||||
|
'extends': [
|
||||||
|
eslint.configs.recommended,
|
||||||
|
...vue.configs['flat/recommended']
|
||||||
|
],
|
||||||
|
'rules': {
|
||||||
|
...typescript.configs.recommended.rules,
|
||||||
|
...style.rules,
|
||||||
|
|
||||||
|
// Vue specific rules
|
||||||
|
'@stylistic/indent': 'off',
|
||||||
|
'vue/html-indent': [
|
||||||
|
'error',
|
||||||
|
4
|
||||||
|
],
|
||||||
|
'vue/html-comment-indent': [
|
||||||
|
'error',
|
||||||
|
4
|
||||||
|
],
|
||||||
|
'vue/script-indent': [
|
||||||
|
'error',
|
||||||
|
4,
|
||||||
|
{
|
||||||
|
'baseIndent': 1,
|
||||||
|
'switchCase': 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'vue/html-self-closing': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'html': {
|
||||||
|
'void': 'never',
|
||||||
|
'normal': 'never',
|
||||||
|
'component': 'always'
|
||||||
|
},
|
||||||
|
'svg': 'always',
|
||||||
|
'math': 'never'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'vue/max-attributes-per-line': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'singleline': 3,
|
||||||
|
'multiline': 1,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
8
package.json
Normal file
8
package.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.37.0",
|
||||||
|
"@stylistic/eslint-plugin": "^5.4.0",
|
||||||
|
"eslint-plugin-vue": "^10.5.1",
|
||||||
|
"typescript-eslint": "^8.46.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,3 +3,4 @@ $bg-color: {{ colour-background-hex }};
|
|||||||
$accent-color: {{ colour-accent-hex }};
|
$accent-color: {{ colour-accent-hex }};
|
||||||
$accent-color-2: {{ colour-accent-2-hex }};
|
$accent-color-2: {{ colour-accent-2-hex }};
|
||||||
$shadow-color: {{ colour-shadow-rgba-03 }};
|
$shadow-color: {{ colour-shadow-rgba-03 }};
|
||||||
|
$monospace-font: {{ font-mono }}
|
||||||
|
|||||||
Reference in New Issue
Block a user